diff --git a/sycl/source/detail/device_impl.hpp b/sycl/source/detail/device_impl.hpp index 8e22fec33944..b96440700aac 100644 --- a/sycl/source/detail/device_impl.hpp +++ b/sycl/source/detail/device_impl.hpp @@ -589,33 +589,27 @@ class device_impl : public std::enable_shared_from_this { } CASE(info::device::usm_device_allocations) { - return get_info_impl_nocheck() - .value_or(0) & + return get_info_impl() & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS; } CASE(info::device::usm_host_allocations) { - return get_info_impl_nocheck().value_or( - 0) & + return get_info_impl() & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS; } CASE(info::device::usm_shared_allocations) { - return get_info_impl_nocheck() - .value_or(0) & + return get_info_impl() & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS; } CASE(info::device::usm_restricted_shared_allocations) { - auto cap_flags = - get_info_impl_nocheck(); - if (!cap_flags.has_val()) - return false; + ur_device_usm_access_capability_flags_t cap_flags = + get_info_impl(); // 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() - .value_or(0) & + return get_info_impl() & UR_DEVICE_USM_ACCESS_CAPABILITY_FLAG_ACCESS; }