[clang] [HIP] change default offload archs (PR #139281)
Alex Voicu via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 05:59:06 PDT 2025
AlexVlx wrote:
> The main obstacle of letting clang emit error when `--offload-arch` is not specified is HIP apps using hipcc as CMAKE_CXX_COMPILER. hipcc adds -xhip by default for .cpp programs. This is a known and long existing issue.
>
> Another option is to have multiple `--offload-arch` options by default, which covers gfx9 generic, gfx10 generic, gfx11 generic, and gfx12 generic. This should make the program work for most of GPU's.
So perhaps we can fork this linguistically? I.e.:
- the HIP language should default to SPIRV (which will work everywhere; additionally, I think that some of the concerns in this thread re: performance / capability are misplaced, considering we're not using generic SPIRV, but that's a different kettle of fish);
- everything else just errors out if --offload-arch / -mcpu are not set.
Trying to add multiple / all offload-archs is just committing to being on an endless treadmill. Part of why we added SPIRV support is to deal with this.
https://github.com/llvm/llvm-project/pull/139281
More information about the cfe-commits
mailing list