[clang] [clang][AMDGPU] Don't define feature macros on host code (PR #83558)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 1 05:57:16 PST 2024
yxsamliu wrote:
Did you try this patch with internal PSDB? This will likely break all HIP programs.
This is because HIP is single source program and users usually expect the common device-side predefined macros is seen in both host and device compilations. e.g. they could write a kernel using the wavefront size macro without conditioning the code for device only. In most cases, they do not care about whether the wavefront size macro is accurate in host side compilation. They just need it to be defined so that the code can be compiled.
This is unfortunate but I think at least the wavefront size macro needs to be kept for host compilation.
https://github.com/llvm/llvm-project/pull/83558
More information about the cfe-commits
mailing list