[clang] [llvm] [OpenMP] Remove 'libomptarget.devicertl.a' fatbinary and use static library (PR #126143)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 19 10:07:13 PDT 2025
jhuber6 wrote:
> > It should only be invoking `nvptx-arch` if the user passed `-march=native`.
>
> Sorry, didn't notice this sentence. Well, _I am_ building with `-march=native` here — after all, other files are built for a CPU. If I change it to, say, `-march=zen2`, then it indeed compiles, with a lot of warnings:
>
> ```
> 'zen2' is not a recognized processor for this target (ignoring processor)
> 'zen2' is not a recognized processor for this target (ignoring processor)
> 'zen2' is not a recognized processor for this target (ignoring processor)
> 'zen2' is not a recognized processor for this target (ignoring processor)
> 'zen2' is not a recognized processor for this target (ignoring processor)
> 'zen2' is not a recognized processor for this target (ignoring processor)
> ```
>
> To be honest, this only proves my point — you shouldn't be invoking `CMAKE_CXX_COMPILER` when you're building for a GPU, since it's a compiler configured to be building for the host CPU.
Hence why the follow-up to this will move it to a separate project where you pass https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_TARGET.html. Right now I guess it's in an awful worst-of-both-worlds state, but I was hoping to get the functional change to the generated code done so I could just do the infrastructure change.
https://github.com/llvm/llvm-project/pull/126143
More information about the llvm-commits
mailing list