2121#include " common.hpp"
2222
2323constexpr sycl::specialization_id<int > int_id;
24- constexpr sycl::specialization_id<double > double_id (3.14 );
24+ constexpr sycl::specialization_id<float > float_id (3 .14f );
2525constexpr sycl::specialization_id<custom_type> custom_type_id;
2626
2727class TestDefaultValuesKernel ;
@@ -76,7 +76,7 @@ bool test_default_values(sycl::queue q) {
7676 }
7777
7878 sycl::buffer<int > int_buffer (1 );
79- sycl::buffer<double > double_buffer (1 );
79+ sycl::buffer<float > float_buffer (1 );
8080 sycl::buffer<custom_type> custom_type_buffer (1 );
8181
8282 auto input_bundle =
@@ -86,12 +86,12 @@ bool test_default_values(sycl::queue q) {
8686 q.submit ([&](sycl::handler &cgh) {
8787 cgh.use_kernel_bundle (exec_bundle);
8888 auto int_acc = int_buffer.get_access <sycl::access::mode::write>(cgh);
89- auto double_acc = double_buffer .get_access <sycl::access::mode::write>(cgh);
89+ auto float_acc = float_buffer .get_access <sycl::access::mode::write>(cgh);
9090 auto custom_type_acc =
9191 custom_type_buffer.get_access <sycl::access::mode::write>(cgh);
9292 cgh.single_task <TestDefaultValuesKernel>([=](sycl::kernel_handler kh) {
9393 int_acc[0 ] = kh.get_specialization_constant <int_id>();
94- double_acc [0 ] = kh.get_specialization_constant <double_id >();
94+ float_acc [0 ] = kh.get_specialization_constant <float_id >();
9595 custom_type_acc[0 ] = kh.get_specialization_constant <custom_type_id>();
9696 });
9797 });
@@ -102,8 +102,8 @@ bool test_default_values(sycl::queue q) {
102102 " integer specialization constant (defined without default value)" ))
103103 return false ;
104104
105- auto double_acc = double_buffer .get_access <sycl::access::mode::read>();
106- if (!check_value (3.14 , double_acc [0 ], " double specialization constant" ))
105+ auto float_acc = float_buffer .get_access <sycl::access::mode::read>();
106+ if (!check_value (3 .14f , float_acc [0 ], " float specialization constant" ))
107107 return false ;
108108
109109 auto custom_type_acc =
@@ -145,9 +145,9 @@ bool test_set_and_get_on_host(sycl::queue q) {
145145 " integer specializaiton constant before setting any value" ))
146146 ++errors;
147147
148- if (!check_value (3.14 ,
149- input_bundle.get_specialization_constant <double_id >(),
150- " double specializaiton constant before setting any value" ))
148+ if (!check_value (3 .14f ,
149+ input_bundle.get_specialization_constant <float_id >(),
150+ " float specializaiton constant before setting any value" ))
151151 ++errors;
152152
153153 custom_type custom_type_ref;
@@ -159,11 +159,11 @@ bool test_set_and_get_on_host(sycl::queue q) {
159159
160160 // Update values
161161 int new_int_value = 42 ;
162- double new_double_value = 3.0 ;
163- custom_type new_custom_type_value (' b' , 1.0 , 12 );
162+ float new_float_value = 3 .0f ;
163+ custom_type new_custom_type_value (' b' , 1 .0f , 12 );
164164
165165 input_bundle.set_specialization_constant <int_id>(new_int_value);
166- input_bundle.set_specialization_constant <double_id>(new_double_value );
166+ input_bundle.set_specialization_constant <float_id>(new_float_value );
167167 input_bundle.set_specialization_constant <custom_type_id>(
168168 new_custom_type_value);
169169
@@ -173,9 +173,9 @@ bool test_set_and_get_on_host(sycl::queue q) {
173173 " integer specializaiton constant after setting a new value" ))
174174 ++errors;
175175
176- if (!check_value (new_double_value ,
177- input_bundle.get_specialization_constant <double_id >(),
178- " double specializaiton constant after setting a value" ))
176+ if (!check_value (new_float_value ,
177+ input_bundle.get_specialization_constant <float_id >(),
178+ " float specializaiton constant after setting a value" ))
179179 ++errors;
180180
181181 if (!check_value (
@@ -193,9 +193,9 @@ bool test_set_and_get_on_host(sycl::queue q) {
193193 " integer specializaiton constant after build" ))
194194 ++errors;
195195
196- if (!check_value (new_double_value ,
197- exec_bundle.get_specialization_constant <double_id >(),
198- " double specializaiton constant after build" ))
196+ if (!check_value (new_float_value ,
197+ exec_bundle.get_specialization_constant <float_id >(),
198+ " float specializaiton constant after build" ))
199199 ++errors;
200200
201201 if (!check_value (new_custom_type_value,
@@ -210,31 +210,31 @@ bool test_set_and_get_on_host(sycl::queue q) {
210210
211211bool test_set_and_get_on_device (sycl::queue q) {
212212 sycl::buffer<int > int_buffer (1 );
213- sycl::buffer<double > double_buffer (1 );
213+ sycl::buffer<float > float_buffer (1 );
214214 sycl::buffer<custom_type> custom_type_buffer (1 );
215215
216216 int new_int_value = 42 ;
217- double new_double_value = 3.0 ;
218- custom_type new_custom_type_value (' b' , 1.0 , 12 );
217+ float new_float_value = 3 .0f ;
218+ custom_type new_custom_type_value (' b' , 1 .0f , 12 );
219219
220220 auto input_bundle =
221221 sycl::get_kernel_bundle<sycl::bundle_state::input>(q.get_context ());
222222 input_bundle.set_specialization_constant <int_id>(new_int_value);
223- input_bundle.set_specialization_constant <double_id>(new_double_value );
223+ input_bundle.set_specialization_constant <float_id>(new_float_value );
224224 input_bundle.set_specialization_constant <custom_type_id>(
225225 new_custom_type_value);
226226 auto exec_bundle = sycl::build (input_bundle);
227227
228228 q.submit ([&](sycl::handler &cgh) {
229229 cgh.use_kernel_bundle (exec_bundle);
230230 auto int_acc = int_buffer.get_access <sycl::access::mode::write>(cgh);
231- auto double_acc = double_buffer .get_access <sycl::access::mode::write>(cgh);
231+ auto float_acc = float_buffer .get_access <sycl::access::mode::write>(cgh);
232232 auto custom_type_acc =
233233 custom_type_buffer.get_access <sycl::access::mode::write>(cgh);
234234
235235 cgh.single_task <TestSetAndGetOnDevice>([=](sycl::kernel_handler kh) {
236236 int_acc[0 ] = kh.get_specialization_constant <int_id>();
237- double_acc [0 ] = kh.get_specialization_constant <double_id >();
237+ float_acc [0 ] = kh.get_specialization_constant <float_id >();
238238 custom_type_acc[0 ] = kh.get_specialization_constant <custom_type_id>();
239239 });
240240 });
@@ -244,9 +244,9 @@ bool test_set_and_get_on_device(sycl::queue q) {
244244 " integer specialization constant" ))
245245 return false ;
246246
247- auto double_acc = double_buffer .get_access <sycl::access::mode::read>();
248- if (!check_value (new_double_value, double_acc [0 ],
249- " double specialization constant" ))
247+ auto float_acc = float_buffer .get_access <sycl::access::mode::read>();
248+ if (!check_value (new_float_value, float_acc [0 ],
249+ " float specialization constant" ))
250250 return false ;
251251
252252 auto custom_type_acc =
0 commit comments