[PATCH] D113925: [HIP] Add HIP scope atomic operations
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 16 06:29:11 PST 2021
yaxunl added inline comments.
================
Comment at: clang/lib/CodeGen/CGAtomic.cpp:1347-1348
break; // Avoid crashing on code with undefined behavior
+ if (!OrderFail)
+ llvm::errs() << "FOO\n";
EmitAtomicOp(*this, E, Dest, Ptr, Val1, Val2, IsWeak, OrderFail, Size,
----------------
debugging code should be removed
================
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:510-514
+ Builder.defineMacro("__HIP_MEMORY_SCOPE_SINGLETHREAD", "1");
+ Builder.defineMacro("__HIP_MEMORY_SCOPE_WAVEFRONT", "2");
+ Builder.defineMacro("__HIP_MEMORY_SCOPE_WORKGROUP", "3");
+ Builder.defineMacro("__HIP_MEMORY_SCOPE_AGENT", "4");
+ Builder.defineMacro("__HIP_MEMORY_SCOPE_SYSTEM", "5");
----------------
these should be moved outside of if (LangOpts.CUDAIsDevice) as they need to be visible to both device and host compilation. The downstream amd-stg-open branch already did this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113925/new/
https://reviews.llvm.org/D113925
More information about the cfe-commits
mailing list