[clang] [HIP] change default offload archs (PR #139281)
Alex Voicu via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 06:19:55 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.
>
> Seems silly to do that when we have the `.hip` extension, but I guess it's a convenience that we can't really turn off at this stage.
>
> > 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.
> > ```
>
> We still rely on external Khronos tools for SPIR-V right? I don't think we can shift that to the default until it's all LLVM.
Sure, however we are actually switching to the BE within the next couple of months, so it would be useful to incorporate that into planning / what we do here. It'd probably be preferable to have one default switch and then stick with that.
https://github.com/llvm/llvm-project/pull/139281
More information about the cfe-commits
mailing list