8000 [SYCL] Add number HW threads per EU query by MrSidims · Pull Request #4901 · intel/llvm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[SYCL] Add number HW threads per EU query #4901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/aspects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum class aspect {
ext_oneapi_srgb = 30,
ext_oneapi_native_assert = 31,
host_debuggable = 32,
ext_intel_gpu_hw_threads_per_eu = 33,
};

} // namespace sycl
Expand Down
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/detail/pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ typedef enum {
PI_DEVICE_INFO_IMAGE_SRGB = 0x10027,
PI_DEVICE_INFO_ATOMIC_64 = 0x10110,
PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 0x10111,
PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU = 0x10112,
PI_EXT_ONEAPI_DEVICE_INFO_MAX_GLOBAL_WORK_GROUPS = 0x20000,
PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_1D = 0x20001,
PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_2D = 0x20002,
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/feature_test.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace sycl {
// Feature test macro definitions

// TODO: Move these feature-test macros to compiler driver.
#define SYCL_EXT_INTEL_DEVICE_INFO 2
#define SYCL_EXT_INTEL_DEVICE_INFO 3
#define SYCL_EXT_ONEAPI_SUB_GROUP_MASK 1
#define SYCL_EXT_ONEAPI_LOCAL_MEMORY 1
// As for SYCL_EXT_ONEAPI_MATRIX:
Expand Down
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/info/device_traits.def
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_simd_width, pi_uint32)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_slices, pi_uint32)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_subslices_per_slice, pi_uint32)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_count_per_subslice, pi_uint32)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_hw_threads_per_eu, pi_uint32)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_max_mem_bandwidth, pi_uint64)
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_mem_channel, bool)
__SYCL_PARAM_TRAITS_SPEC(device, ext_oneapi_srgb, bool)
Expand Down
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/info/info_desc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ enum class device : cl_device_info {
ext_intel_gpu_subslices_per_slice = PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE,
ext_intel_gpu_eu_count_per_subslice =
PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE,
ext_intel_gpu_hw_threads_per_eu = PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU,
ext_intel_max_mem_bandwidth = PI_DEVICE_INFO_MAX_MEM_BANDWIDTH,
ext_intel_mem_channel = PI_MEM_PROPERTIES_CHANNEL,
ext_oneapi_srgb = PI_DEVICE_INFO_IMAGE_SRGB,
Expand Down
1 change: 1 addition & 0 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,7 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
case PI_DEVICE_INFO_GPU_SLICES:
case PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
// TODO: Check if Intel device UUID extension is utilized for CUDA.
// For details about this extension, see
Expand Down
1 change: 1 addition & 0 deletions sycl/plugins/hip/pi_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@ pi_result hip_piDeviceGetInfo(pi_device device, pi_device_info param_name,
case PI_DEVICE_INFO_GPU_SLICES:
case PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
return PI_INVALID_VALUE;

Expand Down
2 changes: 2 additions & 0 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,8 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
return ReturnValue(
pi_uint32{Device->ZeDeviceProperties->numEUsPerSubslice});
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
return ReturnValue(pi_uint32{Device->ZeDeviceProperties->numThreadsPerEU});
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
// currently not supported in level zero runtime
return PI_INVALID_VALUE;
Expand Down
3 changes: 3 additions & 0 deletions sycl/plugins/opencl/pi_opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,15 @@ pi_result piDeviceGetInfo(pi_device device, pi_device_info paramName,
switch (paramName) {
// TODO: Check regularly to see if support in enabled in OpenCL.
// Intel GPU EU device-specific information extensions.
// Some of the queries are enabled by cl_intel_device_attribute_query
// extension, but it's not yet in the Registry.
case PI_DEVICE_INFO_PCI_ADDRESS:
case PI_DEVICE_INFO_GPU_EU_COUNT:
case PI_DEVICE_INFO_GPU_EU_SIMD_WIDTH:
case PI_DEVICE_INFO_GPU_SLICES:
case PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE:
case PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE:
case PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
case PI_DEVICE_INFO_MAX_MEM_BANDWIDTH:
// TODO: Check if device UUID extension is enabled in OpenCL.
// For details about Intel UUID extension, see
Expand Down
5 changes: 5 additions & 0 deletions sycl/source/detail/device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ bool device_impl::has(aspect Aspect) const {
MDevice, PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE,
sizeof(pi_device_type), &device_type,
&return_size) == PI_SUCCESS;
case aspect::ext_intel_gpu_hw_threads_per_eu:
return getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
MDevice, PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU,
sizeof(pi_device_type), &device_type,
&return_size) == PI_SUCCESS;
case aspect::ext_intel_device_info_uuid: {
auto Result = getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
MDevice, PI_DEVICE_INFO_UUID, 0, nullptr, &return_size);
Expand Down
7 changes: 7 additions & 0 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,13 @@ get_device_info_host<info::device::ext_intel_gpu_eu_count_per_subslice>() {
PI_INVALID_DEVICE);
}
template <>
inline cl_uint
get_device_info_host<info::device::ext_intel_gpu_hw_threads_per_eu>() {
throw runtime_error(
"Obtaining the HW threads count per EU is not supported on HOST device",
PI_INVALID_DEVICE);
}
template <>
inline cl_ulong
get_device_info_host<info::device::ext_intel_max_mem_bandwidth>() {
throw runtime_error(
Expand Down
5 changes: 5 additions & 0 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -4382,3 +4382,8 @@ _ZNK2cl4sycl9exception8categoryEv
_ZNK2cl4sycl9kernel_id8get_nameEv
__sycl_register_lib
__sycl_unregister_lib
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131072EEENS3_12param_traitsIS4_XT_EE11return_typeEv
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131075EEENS3_12param_traitsIS4_XT_EE11return_typeEv
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131074EEENS3_12param_traitsIS4_XT_EE11return_typeEv
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE131073EEENS3_12param_traitsIS4_XT_EE11return_typeEv
_ZNK2cl4sycl6device8get_infoILNS0_4info6deviceE65810EEENS3_12param_traitsIS4_XT_EE11return_typeEv
1 change: 1 addition & 0 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
??$get_info@$0EBJD@@device@sycl@cl@@QEBA_NXZ
??$get_info@$0EBJE@@device@sycl@cl@@QEBA_NXZ
??$get_info@$0ECBD@@device@sycl@cl@@QEBA_NXZ
??$get_info@$0BABBC@@device@sycl@cl@@QEBAIXZ
??$get_info@$0JAA@@platform@sycl@cl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
??$get_info@$0JAB@@platform@sycl@cl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
??$get_info@$0JAC@@platform@sycl@cl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
Expand Down
0