[all-commits] [llvm/llvm-project] bed700: [NVPTX] Add __CUDA_ARCH__ macro to standalone NVPT...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Mar 27 16:08:33 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bed7005eb4d4850b6f9d93707213ced5c0c19de0
      https://github.com/llvm/llvm-project/commit/bed7005eb4d4850b6f9d93707213ced5c0c19de0
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M clang/lib/Basic/Targets/NVPTX.cpp
    A clang/test/Frontend/standalone-nvptx-macros.c

  Log Message:
  -----------
  [NVPTX] Add __CUDA_ARCH__ macro to standalone NVPTX compilations

We can now target the NVPTX architecture directly via
`--target=nvptx64-nvidia-cuda`. This currently does not define the
`__CUDA_ARCH__` macro with is used to allow code to target different
codes based on support. This patch simply adds this support.

Reviewed By: tra, jdoerfert

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




More information about the All-commits mailing list