Skip to content

Commit eea7b42

Browse files
committed
[SYCL] Add number HW threads per EU query
The appropriate spec update: intel#4876 Test: intel/llvm-test-suite#550 Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent 0e28541 commit eea7b42

File tree

9 files changed

+24
-0
lines changed

9 files changed

+24
-0
lines changed

sycl/include/CL/sycl/aspects.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum class aspect {
4848
ext_oneapi_srgb = 30,
4949
ext_oneapi_native_assert = 31,
5050
host_debuggable = 32,
51+
ext_intel_gpu_hw_threads_per_eu = 33,
5152
};
5253

5354
} // namespace sycl

sycl/include/CL/sycl/detail/pi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ typedef enum {
301301
PI_DEVICE_INFO_IMAGE_SRGB = 0x10027,
302302
PI_DEVICE_INFO_ATOMIC_64 = 0x10110,
303303
PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 0x10111,
304+
PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU = 0x10120,
304305
PI_EXT_ONEAPI_DEVICE_INFO_MAX_GLOBAL_WORK_GROUPS = 0x20000,
305306
PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_1D = 0x20001,
306307
PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_2D = 0x20002,

sycl/include/CL/sycl/info/device_traits.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_simd_width, pi_uint32)
9595
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_slices, pi_uint32)
9696
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_subslices_per_slice, pi_uint32)
9797
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_count_per_subslice, pi_uint32)
98+
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_hw_threads_per_eu, pi_uint32)
9899
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_max_mem_bandwidth, pi_uint64)
99100
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_mem_channel, bool)
100101
__SYCL_PARAM_TRAITS_SPEC(device, ext_oneapi_srgb, bool)

sycl/include/CL/sycl/info/info_desc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ enum class device : cl_device_info {
156156
ext_intel_gpu_subslices_per_slice = PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE,
157157
ext_intel_gpu_eu_count_per_subslice =
158158
PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE,
159+
ext_intel_gpu_hw_threads_per_eu = PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU,
159160
ext_intel_max_mem_bandwidth = PI_DEVICE_INFO_MAX_MEM_BANDWIDTH,
160161
ext_intel_mem_channel = PI_MEM_PROPERTIES_CHANNEL,
161162
ext_oneapi_srgb = PI_DEVICE_INFO_IMAGE_SRGB,

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,7 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
16751675
case PI_DEVICE_INFO_GPU_SLICES:
16761676
case PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
16771677
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
1678+
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
16781679
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
16791680
// TODO: Check if Intel device UUID extension is utilized for CUDA.
16801681
// For details about this extension, see

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,8 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
24632463
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
24642464
return ReturnValue(
24652465
pi_uint32{Device->ZeDeviceProperties->numEUsPerSubslice});
2466+
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
2467+
return ReturnValue(pi_uint32{Device->ZeDeviceProperties->numThreadsPerEU});
24662468
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
24672469
// currently not supported in level zero runtime
24682470
return PI_INVALID_VALUE;

sycl/source/detail/device_impl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ bool device_impl::has(aspect Aspect) const {
303303
MDevice, PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE,
304304
sizeof(pi_device_type), &device_type,
305305
&return_size) == PI_SUCCESS;
306+
case aspect::ext_intel_gpu_hw_threads_per_eu:
307+
return getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
308+
MDevice, PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU,
309+
sizeof(pi_device_type), &device_type,
310+
&return_size) == PI_SUCCESS;
306311
case aspect::ext_intel_device_info_uuid: {
307312
auto Result = getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
308313
MDevice, PI_DEVICE_INFO_UUID, 0, nullptr, &return_size);

sycl/source/detail/device_info.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,13 @@ get_device_info_host<info::device::ext_intel_gpu_eu_count_per_subslice>() {
12831283
PI_INVALID_DEVICE);
12841284
}
12851285
template <>
1286+
inline cl_uint
1287+
get_device_info_host<info::device::ext_intel_gpu_hw_threads_per_eu>() {
1288+
throw runtime_error(
1289+
"Obtaining the HW threads count per EU is not supported on HOST device",
1290+
PI_INVALID_DEVICE);
1291+
}
1292+
template <>
12861293
inline cl_ulong
12871294
get_device_info_host<info::device::ext_intel_max_mem_bandwidth>() {
12881295
throw runtime_error(

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,3 +4382,8 @@ _ZNK2cl4sycl9exception8categoryEv
43824382
_ZNK2cl4sycl9kernel_id8get_nameEv
43834383
__sycl_register_lib
43844384
__sycl_unregister_lib
4385+
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131072EEENS3_12param_traitsIS4_XT_EE11return_typeEv
4386+
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131075EEENS3_12param_traitsIS4_XT_EE11return_typeEv
4387+
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131074EEENS3_12param_traitsIS4_XT_EE11return_typeEv
4388+
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131073EEENS3_12param_traitsIS4_XT_EE11return_typeEv
4389+
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65824EEENS3_12param_traitsIS4_XT_EE11return_typeEv

0 commit comments

Comments
 (0)