mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-30 04:26:06 +00:00

Currently we define the `__CUDA_ARCH__` macro only in CUDA mode. This patch allows us to use this macro in OpenMP-offloading mode when targeting NVPTX. Reviewed By: tra, tianshilei1992 Differential Revision: https://reviews.llvm.org/D125256
9 lines
501 B
C
9 lines
501 B
C
// REQUIRES: x86-registered-target
|
|
// REQUIRES: nvptx-registered-target
|
|
// REQUIRES: clang-target-64-bits
|
|
|
|
// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 -fopenmp-targets=x86_64-unknown-unknown -o - | FileCheck --check-prefix=CHECK-45-VERSION %s
|
|
// CHECK-45-VERSION: #define _OPENMP 201511
|
|
// RUN: %clang %s -c -E -dM -fopenmp=libomp -nogpulib --offload-arch=sm_70 --offload-device-only -o - | FileCheck --check-prefix=CHECK-CUDA-ARCH %s
|
|
// CHECK-CUDA-ARCH: #define __CUDA_ARCH__ 700
|