[lld] [lldb] [llvm] [compiler-rt] [clang-tools-extra] [libc] [clang] [flang] [libcxx] [NVPTX] Add support for -march=native in standalone NVPTX (PR #79373)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 11:14:01 PST 2024


jhuber6 wrote:

> On the other hand, I'd be OK with providing --offload-arch=native translating into "compile for all present GPU variants", with a possibility to further adjust the selected set with the usual --no-offload-arch-foo, if the user needs to. This will at least produce code that will run on the machine where it's built, be somewhat consistent and is still adjustable by the user when the default choice will inevitably be wrong.

This is what we already do, but this is somewhat tangential. I've updated this patch to present the warning in the case of multiply GPUs being detected, so I don't think there's a concern here with the user being confused. If they have two GPUs, the warning will tell them which one it's using with the correct `sm_` value to specify it manually if they so wish. If there is only one GPU on the system, it should be obvious that it's going to be targeted.

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


More information about the cfe-commits mailing list