@@ -782,8 +782,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
782
782
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE;
783
783
return ReturnValue (Capabilities);
784
784
}
785
- case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
786
- case UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
785
+ case UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
787
786
// SYCL2020 4.6.4.2 minimum mandated capabilities for
788
787
// atomic_fence/memory_scope_capabilities.
789
788
// Because scopes are hierarchical, wider scopes support all narrower
@@ -795,6 +794,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
795
794
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP;
796
795
return ReturnValue (Capabilities);
797
796
}
797
+ case UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
798
+ constexpr ur_memory_scope_capability_flags_t Capabilities =
799
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
800
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
801
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP |
802
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE |
803
+ UR_MEMORY_SCOPE_CAPABILITY_FLAG_SYSTEM;
804
+ return ReturnValue (Capabilities);
805
+ }
798
806
case UR_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {
799
807
// SYCL2020 4.6.4.2 minimum mandated capabilities for
800
808
// atomic_fence_order_capabilities.
@@ -803,6 +811,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
803
811
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
804
812
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
805
813
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL;
814
+ #ifdef __HIP_PLATFORM_NVIDIA__
815
+ // Nvidia introduced fence.sc for seq_cst only since SM 7.0.
816
+ int Major = 0 ;
817
+ UR_CHECK_ERROR (hipDeviceGetAttribute (
818
+ &Major, hipDeviceAttributeComputeCapabilityMajor, hDevice->get ()));
819
+ if (Major >= 7 )
820
+ Capabilities |= UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;
821
+ #else
822
+ Capabilities |= UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;
823
+ #endif
806
824
return ReturnValue (Capabilities);
807
825
}
808
826
case UR_DEVICE_INFO_DEVICE_ID: {
0 commit comments