llvm-project/clang/test/Frontend/standalone-nvptx-macros.c
Joseph Huber bed7005eb4 [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
2023-03-27 18:08:15 -05:00

6 lines
217 B
C

// REQUIRES: nvptx-registered-target
// RUN: %clang %s -c -E -dM --target=nvptx64-nvidia-cuda -march=sm_70 -o - | \
// RUN: FileCheck --check-prefix=CHECK-CUDA-ARCH %s
// CHECK-CUDA-ARCH: #define __CUDA_ARCH__ 700