Skip to content
Open
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
13 changes: 7 additions & 6 deletions sycl/source/detail/device_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,16 +1580,17 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
.value_or(0);
}
CASE(ext_oneapi_clock_sub_group) {
// Will be updated in a follow-up UR patch.
return false;
return get_info_impl_nocheck<UR_DEVICE_INFO_CLOCK_SUB_GROUP_SUPPORT_EXP>()
.value_or(0);
}
CASE(ext_oneapi_clock_work_group) {
// Will be updated in a follow-up UR patch.
return false;
return get_info_impl_nocheck<
UR_DEVICE_INFO_CLOCK_WORK_GROUP_SUPPORT_EXP>()
.value_or(0);
}
CASE(ext_oneapi_clock_device) {
// Will be updated in a follow-up UR patch.
return false;
return get_info_impl_nocheck<UR_DEVICE_INFO_CLOCK_DEVICE_SUPPORT_EXP>()
.value_or(0);
}
else {
return false; // This device aspect has not been implemented yet.
Expand Down
3 changes: 3 additions & 0 deletions sycl/source/detail/ur_device_info_ret_types.inc
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,7 @@ MAP(UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP, ur_bool_t)
MAP(UR_DEVICE_INFO_TIMESTAMP_RECORDING_SUPPORT_EXP, ur_bool_t)
MAP(UR_DEVICE_INFO_KERNEL_LAUNCH_CAPABILITIES, ur_kernel_launch_properties_flags_t)
MAP(UR_DEVICE_INFO_MEMORY_EXPORT_EXPORTABLE_DEVICE_MEM_EXP, ur_bool_t)
MAP(UR_DEVICE_INFO_CLOCK_SUB_GROUP_SUPPORT_EXP, ur_bool_t)
MAP(UR_DEVICE_INFO_CLOCK_WORK_GROUP_SUPPORT_EXP, ur_bool_t)
MAP(UR_DEVICE_INFO_CLOCK_DEVICE_SUPPORT_EXP, ur_bool_t)
// clang-format on
3 changes: 3 additions & 0 deletions sycl/test-e2e/Experimental/clock.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// UNSUPPORTED: cpu
// UNSUPPORTED-INTENDED: Bug in CPU RT. Waiting for the new version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be a bug report link/reference instead.


// REQUIRES: aspect-usm_shared_allocations
// REQUIRES: aspect-ext_oneapi_clock_sub_group || aspect-ext_oneapi_clock_work_group || aspect-ext_oneapi_clock_device
// RUN: %{build} -o %t.out
Expand Down
9 changes: 9 additions & 0 deletions unified-runtime/include/ur_api.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions unified-runtime/source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,36 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,

return ReturnValue(nodeMask);
}
case UR_DEVICE_INFO_CLOCK_SUB_GROUP_SUPPORT_EXP:
case UR_DEVICE_INFO_CLOCK_WORK_GROUP_SUPPORT_EXP:
case UR_DEVICE_INFO_CLOCK_DEVICE_SUPPORT_EXP: {
bool Supported = false;
size_t ExtSize = 0;

CL_RETURN_ON_FAILURE(clGetDeviceInfo(
hDevice->CLDevice, CL_DEVICE_EXTENSIONS, 0, nullptr, &ExtSize));
std::string ExtStr(ExtSize, '\0');
CL_RETURN_ON_FAILURE(clGetDeviceInfo(hDevice->CLDevice,
CL_DEVICE_EXTENSIONS, ExtSize,
ExtStr.data(), nullptr));

if (ExtStr.find("cl_khr_kernel_clock") != std::string::npos) {
cl_device_kernel_clock_capabilities_khr caps = 0;

CL_RETURN_ON_FAILURE(clGetDeviceInfo(
hDevice->CLDevice, CL_DEVICE_KERNEL_CLOCK_CAPABILITIES_KHR,
sizeof(cl_device_kernel_clock_capabilities_khr), &caps, nullptr));

if ((propName == UR_DEVICE_INFO_CLOCK_SUB_GROUP_SUPPORT_EXP &&
(caps & CL_DEVICE_KERNEL_CLOCK_SCOPE_SUB_GROUP_KHR)) ||
(propName == UR_DEVICE_INFO_CLOCK_WORK_GROUP_SUPPORT_EXP &&
(caps & CL_DEVICE_KERNEL_CLOCK_SCOPE_WORK_GROUP_KHR)) ||
(propName == UR_DEVICE_INFO_CLOCK_DEVICE_SUPPORT_EXP &&
(caps & CL_DEVICE_KERNEL_CLOCK_SCOPE_DEVICE_KHR)))
Supported = true;
}
return ReturnValue(Supported);
}
// TODO: We can't query to check if these are supported, they will need to be
// manually updated if support is ever implemented.
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
Expand Down
Loading