File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -214,11 +214,12 @@ template <typename T> struct Atomic {
214
214
};
215
215
216
216
// Issue a thread fence with the given memory ordering.
217
- LIBC_INLINE void atomic_thread_fence ([[maybe_unused]] MemoryOrder mem_ord) {
218
- // The NVPTX backend currently does not support atomic thread fences so we use a
219
- // full system fence instead.
220
- #ifdef LIBC_TARGET_ARCH_IS_NVPTX
221
- __nvvm_membar_sys ();
217
+ LIBC_INLINE void atomic_thread_fence (
218
+ MemoryOrder mem_ord,
219
+ [[maybe_unused]] MemoryScope mem_scope = MemoryScope::DEVICE) {
220
+ #if __has_builtin(__scoped_atomic_thread_fence)
221
+ __scoped_atomic_thread_fence (static_cast <int >(mem_ord),
222
+ static_cast <int >(mem_scope));
222
223
#else
223
224
__atomic_thread_fence (static_cast <int >(mem_ord));
224
225
#endif
You can’t perform that action at this time.
0 commit comments