aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAlex Voicu <alexandru.voicu@amd.com>2025-05-07 14:14:25 +0100
committerGitHub <noreply@github.com>2025-05-07 14:14:25 +0100
commit3feb8b42e973f935883bc9e779645ecdae1a586d (patch)
tree1c4e3fa3a665a039533ea766e69da17c42023024 /clang/lib/Frontend/InitPreprocessor.cpp
parent5dd1421da6c60700f2cb81a13fb5231bb965f0a6 (diff)
downloadllvm-3feb8b42e973f935883bc9e779645ecdae1a586d.zip
llvm-3feb8b42e973f935883bc9e779645ecdae1a586d.tar.gz
llvm-3feb8b42e973f935883bc9e779645ecdae1a586d.tar.bz2
[HIP][HIPSTDPAR] Re-work allocation interposition for `hipstdpar` (#138790)
The allocation interposition mode had a number of issues, which are primarily addressed in the library component via <https://github.com/ROCm/rocThrust/pull/543>. However, it is necessary to interpose some additional symbols, which this patch does. Furthermore, to implement this in a compatible way, we guard the new implementation under a V1 macro, which is defined in addition to the existing `__HIPSTDPAR_INTERPOSE_ALLOC__` one.
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 906b0fa..96d6fb6 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -618,8 +618,10 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__HIP_MEMORY_SCOPE_SYSTEM", "5");
if (LangOpts.HIPStdPar) {
Builder.defineMacro("__HIPSTDPAR__");
- if (LangOpts.HIPStdParInterposeAlloc)
+ if (LangOpts.HIPStdParInterposeAlloc) {
Builder.defineMacro("__HIPSTDPAR_INTERPOSE_ALLOC__");
+ Builder.defineMacro("__HIPSTDPAR_INTERPOSE_ALLOC_V1__");
+ }
}
if (LangOpts.CUDAIsDevice) {
Builder.defineMacro("__HIP_DEVICE_COMPILE__");