Skip to content
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

[SYCL] Align execution_capability info with spec #16673

Merged
merged 4 commits into from
Jan 23, 2025
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
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
Loading