[clang] [Clang][HIP] Warn when __AMDGCN_WAVEFRONT_SIZE is used in host code without relying on target-dependent overload resolution (PR #109663)
Alex Voicu via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 2 05:52:52 PDT 2024
AlexVlx wrote:
I don't think we should rely on these on the host at all, the addition was a design mistake initially, we probably should not double down on it. The wave size is an intrinsic property of the target, the host doesn't really have that property; there are canonical ways of querying the hardware's warp/wave size from CUDA/HIP, which folks happily use on the CUDA side since there's no `__NVPTX_WARP_SIZE` and there never has been one.
So, IMHO, we should not add even more macros / try to figure out rituals to make this work. Warn it's deprecated and broken-ish, get people off of it, forget we made a mistake here seems preferable. I don't think #83558 made a very strong case for keeping this around / trying to figure out creative ways to make it not not work, beyond "we have technical debt with it" (we do, but such things happen, and sometimes it does need clearing up, even if it's non-trivial). `warpSize` is not `constexpr` / `consteval` in CUDA, so that is another arbitrary point of variance we should consider removing (which would remove the main raison d'etre for the macro).
https://github.com/llvm/llvm-project/pull/109663
More information about the cfe-commits
mailing list