[PATCH] D128090: [Clang][OpenMP] Process multi-arch compilation options given via -march

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 13 11:25:04 PDT 2022


tra added a comment.

In D128090#3648999 <https://reviews.llvm.org/D128090#3648999>, @jhuber6 wrote:

> Right now there's `CLANG_OPENMP_NVPTX_DEFAULT_ARCH`, which is defined by CMake to be the architecture of the system used to build clang

That does not make sense to me. Most of the time clang would be built on a machine without a GPU, so I don't understand how one would derive a sensible value for CLANG_OPENMP_NVPTX_DEFAULT_ARCH there.
The vast majority of users will use official release builds of clang and that has no conceivable way to give a sensible default for any specific user. Any guess would be OK sometimes, but it would be wrong most of the time.

I'm all for providing a sensible default, but there's no such thing when it comes for GPUs. CUDA falls back on the oldest supported GPU architecture which has the only benefit of working for occasional manual tinkering and is being consistently wrong for about everyone and forcing them to specify the actual offload targets relevant to their use case.
So far it's the least bad and somewhat consistent approach I've seen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128090



More information about the cfe-commits mailing list