[PATCH] D150136: [Clang] Change default triple to LLVM_HOST_TRIPLE for the CUDA toolchain

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 12:33:11 PDT 2023


jhuber6 added a comment.

In D150136#4327570 <https://reviews.llvm.org/D150136#4327570>, @tra wrote:

> The change may be an improvement, but we may still have a potential issue here.
>
> E.g. ideally we may want to be able to cross-compile a CUDA app on a powerpc or ARM build host targeting NVIDIA GPU on a x86 host. So, the compilation tools would need to be found for the powerpc/arm host, but the the pair of triples used during compilation would have to be x86 and nvptx.

So, this triple is only used for locating the CUDA library itself. In that case it's generally assumed that it will match whatever file structure the host computer is using. Specifically, right now all it's used for is `HostTriple.isOSWindows()`.

> In this situation the LLVM_HOST_TRIPLE would not be the right triple at all. Does OpenMP currently handle the cross-compilation scenario above?

I don't think anyone's tried OpenMP with cross compilation. Most likely because it's only supported on Linux currently. I actually don't know what would happen if you tried.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150136/new/

https://reviews.llvm.org/D150136



More information about the cfe-commits mailing list