[OpenMP] Remove hack around missing atomic load (#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.
This commit is contained in:
Joseph Huber
2025-01-16 15:17:15 -06:00
committed by GitHub
parent d49a2d2bc9
commit 1c00d0d776

View File

@@ -66,7 +66,7 @@ V add(Ty *Address, V Val, atomic::OrderingTy Ordering) {
template <typename Ty, typename V = utils::remove_addrspace_t<Ty>>
V load(Ty *Address, atomic::OrderingTy Ordering) {
return add(Address, Ty(0), Ordering);
return __scoped_atomic_load_n(Address, Ordering, __MEMORY_SCOPE_DEVICE);
}
template <typename Ty, typename V = utils::remove_addrspace_t<Ty>>