Skip to content

[NFCI][SYCL] Use get_info_impl (not _nocheck) for USM info descriptors #18453

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 1 commit into from
May 14, 2025
Merged
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
20 changes: 7 additions & 13 deletions sycl/source/detail/device_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,33 +589,27 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
}

CASE(info::device::usm_device_allocations) {
return get_info_impl_nocheck<UR_DEVICE_INFO_USM_DEVICE_SUPPORT>()
.value_or(0) &
return get_info_impl<UR_DEVICE_INFO_USM_DEVICE_SUPPORT>() &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@intel/unified-runtime-reviewers , are any of these APIs expected to return a meaningful error that isn't an indication of everything being terribly broken?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, these aren't optional queries so it should be success or catastrophic failure as you say

UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS;
}
CASE(info::device::usm_host_allocations) {
return get_info_impl_nocheck<UR_DEVICE_INFO_USM_HOST_SUPPORT>().value_or(
0) &
return get_info_impl<UR_DEVICE_INFO_USM_HOST_SUPPORT>() &
UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS;
}
CASE(info::device::usm_shared_allocations) {
return get_info_impl_nocheck<UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT>()
.value_or(0) &
return get_info_impl<UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT>() &
UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS;
}
CASE(info::device::usm_restricted_shared_allocations) {
auto cap_flags =
get_info_impl_nocheck<UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT>();
if (!cap_flags.has_val())
return false;
ur_device_usm_access_capability_flags_t cap_flags =
get_info_impl<UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT>();
// Check that we don't support any cross device sharing
return !(cap_flags.value() &
return !(cap_flags &
(UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS |
UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_CONCURRENT_ACCESS));
}
CASE(info::device::usm_system_allocations) {
return get_info_impl_nocheck<UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT>()
.value_or(0) &
return get_info_impl<UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT>() &
UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS;
}

Expand Down