From 3feb8b42e973f935883bc9e779645ecdae1a586d Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Wed, 7 May 2025 14:14:25 +0100 Subject: [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 . 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. --- clang/lib/Frontend/InitPreprocessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/InitPreprocessor.cpp') 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__"); -- cgit v1.1