@@ -794,15 +794,21 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
794
794
return ReturnValue (Capabilities);
795
795
}
796
796
case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
797
- // SYCL2020 4.6.4.2 minimum mandated capabilities for
798
- // atomic_fence/memory_scope_capabilities.
799
- // Because scopes are hierarchical, wider scopes support all narrower
800
- // scopes. At a minimum, each device must support WORK_ITEM, SUB_GROUP and
801
- // WORK_GROUP. (https://github.com/KhronosGroup/SYCL-Docs/pull/382)
802
797
ur_memory_scope_capability_flags_t Capabilities =
803
798
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
804
799
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
805
- UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP;
800
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP |
801
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE;
802
+ #if __HIP_PLATFORM_NVIDIA__
803
+ // Nvidia introduced system scope atomics only since SM 6.0.
804
+ int Major = 0 ;
805
+ UR_CHECK_ERROR (hipDeviceGetAttribute (
806
+ &Major, hipDeviceAttributeComputeCapabilityMajor, hDevice->get ()));
807
+ if (Major >= 6 )
808
+ Capabilities |= UR_MEMORY_SCOPE_CAPABILITY_FLAG_SYSTEM;
809
+ #else
810
+ Capabilities |= UR_MEMORY_SCOPE_CAPABILITY_FLAG_SYSTEM;
811
+ #endif
806
812
return ReturnValue (Capabilities);
807
813
}
808
814
case UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
0 commit comments