diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-11-22 14:37:02 -0500 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2021-11-23 10:13:37 -0500 |
commit | e13246a2ec3dfc13838d43099ca9111c780d2c5e (patch) | |
tree | fc8ef5934ed8348713ffceb9e64e865eb693dfec /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | b0784d1d14246e5d662172e9af6e85776b81fdf0 (diff) | |
download | llvm-e13246a2ec3dfc13838d43099ca9111c780d2c5e.zip llvm-e13246a2ec3dfc13838d43099ca9111c780d2c5e.tar.gz llvm-e13246a2ec3dfc13838d43099ca9111c780d2c5e.tar.bz2 |
[HIP] Add HIP scope atomic operations
Add an AtomicScopeModel for HIP and support for OpenCL builtins
that are missing in HIP.
Patch by: Michael Liao
Revised by: Anshil Ghandi
Reviewed by: Yaxun Liu
Differential Revision: https://reviews.llvm.org/D113925
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 0ecb024..0c15344 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -505,6 +505,11 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, if (LangOpts.HIP) { Builder.defineMacro("__HIP__"); Builder.defineMacro("__HIPCC__"); + 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"); if (LangOpts.CUDAIsDevice) Builder.defineMacro("__HIP_DEVICE_COMPILE__"); } |