Skip to content

Commit 1c00d0d

Browse files
authored
[OpenMP] Remove hack around missing atomic load (llvm#122781)
Summary: We used to do a fetch add of zero to approximate a load. This is because the NVPTX backend didn't handle this properly. It's not an issue anymore so simply use the proper atomic builtin.
1 parent d49a2d2 commit 1c00d0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

offload/DeviceRTL/include/Synchronization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ V add(Ty *Address, V Val, atomic::OrderingTy Ordering) {
6666

6767
template <typename Ty, typename V = utils::remove_addrspace_t<Ty>>
6868
V load(Ty *Address, atomic::OrderingTy Ordering) {
69-
return add(Address, Ty(0), Ordering);
69+
return __scoped_atomic_load_n(Address, Ordering, __MEMORY_SCOPE_DEVICE);
7070
}
7171

7272
template <typename Ty, typename V = utils::remove_addrspace_t<Ty>>

0 commit comments

Comments
 (0)