[clang] [clang][Driver][HIP] Add support for mixing AMDGCNSPIRV & concrete `offload-arch`s. (PR #113509)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 16:50:05 PDT 2024


jhuber6 wrote:

> It's how it works today, I believe: `--offload-arch` unambiguously establishes the toolchain

It's pretty ambiguous, right now it mostly works through a combination of the file type and good guessing because the targets people care about now have distinct names. For OpenMP, you can offload to x64 CPUs or whatever and then it doesn't work via `--offload-arch` because there's not a distinct CPU name we can infer the triple based on. For HIP we just infer the triple that it's AMD, but this SPIR-V thing throws the same wrench that OpenMP has. Maybe in the future someone will want `clang++ -x cuda foo.cpp --offload-arch=gfx1030` as well, who knows.

I don't think this is a blocker, but I think it bears deep consideration on how we expect these toolchains to actually work.

https://github.com/llvm/llvm-project/pull/113509


More information about the cfe-commits mailing list