File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -214,13 +214,14 @@ template <typename T> struct Atomic {
214214};
215215
216216// 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+ return __scoped_atomic_thread_fence (static_cast <int >(mem_ord),
222+ static_cast <int >(mem_scope));
222223#else
223- __atomic_thread_fence (static_cast <int >(mem_ord));
224+ return __atomic_thread_fence (static_cast <int >(mem_ord));
224225#endif
225226}
226227
You can’t perform that action at this time.
0 commit comments