[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 06:44:58 PST 2024
yxsamliu wrote:
in HIP headers, warpSize is defined with __AMDGCN_WAVEFRONT_SIZE and there are a bunch of uses of __AMDGCN_WAVEFRONT_SIZE or warpSize as constants:
https://github.com/search?q=repo%3AROCm%2Fclr%20__AMDGCN_WAVEFRONT_SIZE&type=code
These can be fixed relatively easily by conditioning them for device compilation only and only declare those device functions for host compilation. However, the difficult part is HIP apps that uses warpSize as constants. They all need to make similar changes. In the case of rocprim, that is non-trivial.
https://github.com/llvm/llvm-project/pull/83558
More information about the cfe-commits
mailing list