Skip to content

Commit 7b4200e

Browse files
authored
[SYCLomatic] Refine dpct::get_max_computeunits() to leverage SYCL_EXT_ONEAPI_NUM_COMPUTE_UNITS SYCL extension if it is available(#2651)
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
1 parent 014d626 commit 7b4200e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/runtime/dpct-rt/include/dpct/device.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,13 @@ static void get_device_info(device_info &out, const sycl::device &dev) {
319319
prop.set_max_clock_frequency(
320320
dev.get_info<sycl::info::device::max_clock_frequency>() * 1000);
321321

322+
#ifdef SYCL_EXT_ONEAPI_NUM_COMPUTE_UNITS
323+
prop.set_max_compute_units(
324+
dev.get_info<sycl::ext::oneapi::info::device::num_compute_units>());
325+
#else
322326
prop.set_max_compute_units(
323327
dev.get_info<sycl::info::device::max_compute_units>());
328+
#endif
324329
prop.set_max_work_group_size(
325330
dev.get_info<sycl::info::device::max_work_group_size>());
326331
prop.set_global_mem_size(dev.get_info<sycl::info::device::global_mem_size>());

0 commit comments

Comments
 (0)