[all-commits] [llvm/llvm-project] 52b9a3: [OpenMP] Make `-fopenmp-target=` use the `nvptx-ar...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Jan 13 14:52:33 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52b9a3974244183806ba862e161670d79885443a
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-01-13 (Fri, 13 Jan 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/Cuda.cpp
    M clang/test/Driver/openmp-system-arch.c

  Log Message:
  [OpenMP] Make `-fopenmp-target=` use the `nvptx-arch` tool

Previously, if the user did not provide an architecture when using
`-fopenmp-targets=nvptx64` we used the value from
`CLANG_OPENMP_DEFAULT_NVPTX_ARCH` which is defined at compile time. This
isn't ideal because it means that the default is set when the LLVM
compiler it built. Instead this patch uses the `nvptx-arch` tool to
query it at runtime. This matches the existing behaviour of the AMDGPU
toolchain with its `amdgpu-arch` tool.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D141708

  Commit: d1f4bfd2a8b0b347aeaf6d486e4132af65b9ccf0
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-01-13 (Fri, 13 Jan 2023)

  Changed paths:
    M clang/CMakeLists.txt
    M clang/include/clang/Config/config.h.cmake
    M llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
    M utils/bazel/llvm-project-overlay/clang/include/clang/Config/config.h

  Log Message:
  [Clang] Remove `CLANG_OPENMP_NVPTX_DEFAULT_ARCH` CMake option.

The `CLANG_OPENMP_NVPTX_DEFAULT_ARCH` is a static build configuration to
set the default OpenMP value. This was replaced in D141708 with the use
of the `nvptx-arch` tool which lets us query this at runtime instead.
This makes the behaviour between AMD and NVIDIA be more consisten and
allows users to have a default architecture that does not rely on
whoever configured the LLVM build.

Depends on D141708

Reviewed By: tra, MaskRay

Differential Revision: https://reviews.llvm.org/D141723

Compare: https://github.com/llvm/llvm-project/compare/488bea797e16...d1f4bfd2a8b0

More information about the All-commits mailing list