Skip to content

Commit

Permalink
[SYCL] Align execution_capability info with spec (#16673)
Browse files Browse the repository at this point in the history
Aligns behavior with
https://github.com/KhronosGroup/SYCL-Docs/pull/625/files
Test update to pair it with:
KhronosGroup/SYCL-CTS#1020

Done in RT for simplicity. 
Since execution_capability is marked as deprecated I would suggest to
make update in UR & UR adapters after it is completely removed.

---------

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
  • Loading branch information
KseniyaTikhomirova authored Jan 23, 2025
1 parent 9da9bc8 commit 4e5a72e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ template <>
struct get_device_info_impl<std::vector<info::execution_capability>,
info::device::execution_capabilities> {
static std::vector<info::execution_capability> get(const DeviceImplPtr &Dev) {
if (Dev->getBackend() != backend::opencl)
throw exception(make_error_code(errc::invalid),
"info::device::execution_capabilities is available for "
"backend::opencl only");

ur_device_exec_capability_flag_t result;
Dev->getAdapter()->call<UrApiKind::urDeviceGetInfo>(
Dev->getHandleRef(),
Expand Down
14 changes: 11 additions & 3 deletions sycl/test-e2e/Basic/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,17 @@ int main() {
dev, "Is compiler available");
print_info<info::device::is_linker_available, bool>(dev,
"Is linker available");
print_info<info::device::execution_capabilities,
std::vector<info::execution_capability>>(dev,
"Execution capabilities");
try {
print_info<info::device::execution_capabilities,
std::vector<info::execution_capability>>(
dev, "Execution capabilities");
assert(backend == sycl::backend::opencl &&
"An exception is expected for non OpenCL backend");
} catch (const sycl::exception &e) {
assert(e.code() == sycl::errc::invalid &&
backend != sycl::backend::opencl && "Unexpected exception");
}

print_info<info::device::queue_profiling, bool>(dev, "Queue profiling");
print_info<info::device::built_in_kernels, std::vector<std::string>>(
dev, "Built in kernels");
Expand Down

0 comments on commit 4e5a72e

Please sign in to comment.