[clang] [Clang][HIP] Add LLVM vendored device headers for `*-llvm` triple (PR #203980)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 15 12:47:55 PDT 2026
================
@@ -252,6 +252,12 @@ void AMDGPUTargetInfo::getTargetDefines(const LangOptions &Opts,
else
Builder.defineMacro("__R600__");
+ // The 'llvm' environment selects the upstream, ROCm Device Library-free
+ // device runtime. Expose it so headers can route to builtin/libclc/libc
+ // backed implementations instead of the ockl/ocml functions.
+ if (getTriple().getEnvironment() == llvm::Triple::LLVM)
+ Builder.defineMacro("__AMDGCN_LLVM__");
----------------
jhuber6 wrote:
Sure, I can rename it. Could even just call it `__HIP_LLVM__` or something.
https://github.com/llvm/llvm-project/pull/203980
More information about the cfe-commits
mailing list