[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 24 12:51:28 PST 2021


yaxunl added a comment.

we also need a sema test like clang/test/SemaOpenCL/atomic-ops.cl



================
Comment at: clang/test/CodeGenCUDA/atomic-ops.cu:30-32
+  val = __hip_atomic_load(ptr, __HIP_MEMORY_SCOPE_SINGLETHREAD);
+  __hip_atomic_store(ptr, ptr2, 5);
+  flag = __hip_atomic_compare_exchange_weak(ptr, ptr2, &val, desired, __HIP_MEMORY_SCOPE_WORKGROUP);
----------------
all three builtins need to accept memory order parameter. check clang/test/CodeGenOpenCL/atomic-ops.cl for reference


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114553/new/

https://reviews.llvm.org/D114553



More information about the cfe-commits mailing list