Introduce __hip_atomic_load, __hip_atomic_store and __hip_atomic_compare_exchange_weak
builtins in HIP.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
we also need a sema test like clang/test/SemaOpenCL/atomic-ops.cl
clang/test/CodeGenCUDA/atomic-ops.cu | ||
---|---|---|
26–28 | all three builtins need to accept memory order parameter. check clang/test/CodeGenOpenCL/atomic-ops.cl for reference |
- added order argument in the builtins and changed the tests accordingly
- adding Sema test
clang/test/CodeGenCUDA/atomic-ops.cu | ||
---|---|---|
17 | should have atomic, syncscope and monotonic. same as below | |
28 | the signature of __hip_atomic_compare_exchange_weak is the same as __hip_atomic_compare_exchange_strong and should be called with the same arguments. It should end up with one atomic cmpxchg instruction in IR. same as below | |
clang/test/SemaCUDA/atomic-ops.cu | ||
11 | should use predefined macros for memory order, e.g. __ATOMIC_RELAXED. same as below | |
68 | signature is wrong. see above comments. |
addressed feedback including
- correction of function signatures
- checking for order combinations
- correcting expected store atomic instruction
- using predefined macros for memory order
clang/test/SemaCUDA/atomic-ops.cu | ||
---|---|---|
70–75 | pls use pre-defined macros for memory order |
should have atomic, syncscope and monotonic. same as below