Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit f0da2bb

Browse files
[SYCL][NFC] Modernize Basic/info.cpp (#1558)
Replaced usages of `cl_*` types with data types listed in SYCL 2020 spec. The only exception is `info::reference_count`: I can't find this query in the spec and therefore left `cl_*` type in place, but prefixed it with `opencl::` namespace so it matches its defintion in SYCL 2020.
1 parent 49c4977 commit f0da2bb

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

SYCL/Basic/info.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ int main() {
213213
device dev(selector.select_device());
214214

215215
print_info<info::device::device_type, info::device_type>(dev, "Device type");
216-
print_info<info::device::vendor_id, sycl::cl_uint>(dev, "Vendor ID");
217-
print_info<info::device::max_compute_units, sycl::cl_uint>(
216+
print_info<info::device::vendor_id, std::uint32_t>(dev, "Vendor ID");
217+
print_info<info::device::max_compute_units, std::uint32_t>(
218218
dev, "Max compute units");
219-
print_info<info::device::max_work_item_dimensions, sycl::cl_uint>(
219+
print_info<info::device::max_work_item_dimensions, std::uint32_t>(
220220
dev, "Max work item dimensions");
221221
print_info<info::device::max_work_item_sizes<1>, id<1>>(
222222
dev, "Max work item sizes 1D");
@@ -226,44 +226,44 @@ int main() {
226226
dev, "Max work item sizes 3D");
227227
print_info<info::device::max_work_group_size, size_t>(dev,
228228
"Max work group size");
229-
print_info<info::device::preferred_vector_width_char, sycl::cl_uint>(
229+
print_info<info::device::preferred_vector_width_char, std::uint32_t>(
230230
dev, "Preferred vector width char");
231-
print_info<info::device::preferred_vector_width_short, sycl::cl_uint>(
231+
print_info<info::device::preferred_vector_width_short, std::uint32_t>(
232232
dev, "Preferred vector width short");
233-
print_info<info::device::preferred_vector_width_int, sycl::cl_uint>(
233+
print_info<info::device::preferred_vector_width_int, std::uint32_t>(
234234
dev, "Preferred vector width int");
235-
print_info<info::device::preferred_vector_width_long, sycl::cl_uint>(
235+
print_info<info::device::preferred_vector_width_long, std::uint32_t>(
236236
dev, "Preferred vector width long");
237-
print_info<info::device::preferred_vector_width_float, sycl::cl_uint>(
237+
print_info<info::device::preferred_vector_width_float, std::uint32_t>(
238238
dev, "Preferred vector width float");
239-
print_info<info::device::preferred_vector_width_double, sycl::cl_uint>(
239+
print_info<info::device::preferred_vector_width_double, std::uint32_t>(
240240
dev, "Preferred vector width double");
241-
print_info<info::device::preferred_vector_width_half, sycl::cl_uint>(
241+
print_info<info::device::preferred_vector_width_half, std::uint32_t>(
242242
dev, "Preferred vector width half");
243-
print_info<info::device::native_vector_width_char, sycl::cl_uint>(
243+
print_info<info::device::native_vector_width_char, std::uint32_t>(
244244
dev, "Native vector width char");
245-
print_info<info::device::native_vector_width_short, sycl::cl_uint>(
245+
print_info<info::device::native_vector_width_short, std::uint32_t>(
246246
dev, "Native vector width short");
247-
print_info<info::device::native_vector_width_int, sycl::cl_uint>(
247+
print_info<info::device::native_vector_width_int, std::uint32_t>(
248248
dev, "Native vector width int");
249-
print_info<info::device::native_vector_width_long, sycl::cl_uint>(
249+
print_info<info::device::native_vector_width_long, std::uint32_t>(
250250
dev, "Native vector width long");
251-
print_info<info::device::native_vector_width_float, sycl::cl_uint>(
251+
print_info<info::device::native_vector_width_float, std::uint32_t>(
252252
dev, "Native vector width float");
253-
print_info<info::device::native_vector_width_double, sycl::cl_uint>(
253+
print_info<info::device::native_vector_width_double, std::uint32_t>(
254254
dev, "Native vector width double");
255-
print_info<info::device::native_vector_width_half, sycl::cl_uint>(
255+
print_info<info::device::native_vector_width_half, std::uint32_t>(
256256
dev, "Native vector width half");
257257
/*TODO: uncomment when problem with frequency detection is fixed
258-
print_info<info::device::max_clock_frequency, sycl::cl_uint>(
258+
print_info<info::device::max_clock_frequency, std::uint32_t>(
259259
dev, "Max clock frequency");*/
260-
print_info<info::device::address_bits, sycl::cl_uint>(dev, "Address bits");
261-
print_info<info::device::max_mem_alloc_size, sycl::cl_ulong>(
260+
print_info<info::device::address_bits, std::uint32_t>(dev, "Address bits");
261+
print_info<info::device::max_mem_alloc_size, std::uint64_t>(
262262
dev, "Max mem alloc size");
263263
print_info<info::device::image_support, bool>(dev, "Image support");
264-
print_info<info::device::max_read_image_args, sycl::cl_uint>(
264+
print_info<info::device::max_read_image_args, std::uint32_t>(
265265
dev, "Max read image args");
266-
print_info<info::device::max_write_image_args, sycl::cl_uint>(
266+
print_info<info::device::max_write_image_args, std::uint32_t>(
267267
dev, "Max write image args");
268268
print_info<info::device::image2d_max_width, size_t>(dev, "Image2D max width");
269269
print_info<info::device::image2d_max_height, size_t>(dev,
@@ -276,10 +276,10 @@ int main() {
276276
dev, "Image max buffer size");
277277
print_info<info::device::image_max_array_size, size_t>(
278278
dev, "Image max array size");
279-
print_info<info::device::max_samplers, sycl::cl_uint>(dev, "Max samplers");
279+
print_info<info::device::max_samplers, std::uint32_t>(dev, "Max samplers");
280280
print_info<info::device::max_parameter_size, size_t>(dev,
281281
"Max parameter size");
282-
print_info<info::device::mem_base_addr_align, sycl::cl_uint>(
282+
print_info<info::device::mem_base_addr_align, std::uint32_t>(
283283
dev, "Mem base addr align");
284284
print_info<info::device::half_fp_config, std::vector<info::fp_config>>(
285285
dev, "Half fp config");
@@ -289,20 +289,20 @@ int main() {
289289
dev, "Double fp config");
290290
print_info<info::device::global_mem_cache_type, info::global_mem_cache_type>(
291291
dev, "Global mem cache type");
292-
print_info<info::device::global_mem_cache_line_size, sycl::cl_uint>(
292+
print_info<info::device::global_mem_cache_line_size, std::uint32_t>(
293293
dev, "Global mem cache line size");
294-
print_info<info::device::global_mem_cache_size, sycl::cl_ulong>(
294+
print_info<info::device::global_mem_cache_size, std::uint64_t>(
295295
dev, "Global mem cache size");
296-
print_info<info::device::global_mem_size, sycl::cl_ulong>(dev,
297-
"Global mem size");
298-
print_info<info::device::max_constant_buffer_size, sycl::cl_ulong>(
296+
print_info<info::device::global_mem_size, std::uint64_t>(dev,
297+
"Global mem size");
298+
print_info<info::device::max_constant_buffer_size, std::uint64_t>(
299299
dev, "Max constant buffer size");
300-
print_info<info::device::max_constant_args, sycl::cl_uint>(
300+
print_info<info::device::max_constant_args, std::uint32_t>(
301301
dev, "Max constant args");
302302
print_info<info::device::local_mem_type, info::local_mem_type>(
303303
dev, "Local mem type");
304-
print_info<info::device::local_mem_size, sycl::cl_ulong>(dev,
305-
"Local mem size");
304+
print_info<info::device::local_mem_size, std::uint64_t>(dev,
305+
"Local mem size");
306306
print_info<info::device::error_correction_support, bool>(
307307
dev, "Error correction support");
308308
print_info<info::device::host_unified_memory, bool>(dev,
@@ -341,7 +341,7 @@ int main() {
341341
std::cout << "Expected exception has been caught: " << e.what()
342342
<< std::endl;
343343
}
344-
print_info<info::device::partition_max_sub_devices, sycl::cl_uint>(
344+
print_info<info::device::partition_max_sub_devices, std::uint32_t>(
345345
dev, "Partition max sub devices");
346346
print_info<info::device::partition_properties,
347347
std::vector<info::partition_property>>(dev,
@@ -355,8 +355,8 @@ int main() {
355355
print_info<info::device::partition_type_affinity_domain,
356356
info::partition_affinity_domain>(dev,
357357
"Partition type affinity domain");
358-
print_info<info::device::reference_count, sycl::cl_uint>(dev,
359-
"Reference count");
358+
print_info<info::device::reference_count, sycl::opencl::cl_uint>(
359+
dev, "Reference count");
360360

361361
std::cout << separator << "Platform information\n" << separator;
362362
platform plt(dev.get_platform());

0 commit comments

Comments
 (0)