From 48c8948f49c2084365776cd9e9624162021e5ec7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 4 Dec 2020 15:39:16 -0700 Subject: [PATCH] update to latest clang C headers --- lib/include/__clang_cuda_complex_builtins.h | 6 +++--- lib/include/openmp_wrappers/complex | 2 ++ lib/include/openmp_wrappers/complex.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/include/__clang_cuda_complex_builtins.h b/lib/include/__clang_cuda_complex_builtins.h index 8c10ff6b461fd9391667c0c3e30d404b34dc4d87..d924487ab28547636f732bcee942b44c1fa7f04a 100644 --- a/lib/include/__clang_cuda_complex_builtins.h +++ b/lib/include/__clang_cuda_complex_builtins.h @@ -16,7 +16,7 @@ // to work with CUDA and OpenMP target offloading [in C and C++ mode].) #pragma push_macro("__DEVICE__") -#ifdef _OPENMP +#ifdef __OPENMP_NVPTX__ #pragma omp declare target #define __DEVICE__ __attribute__((noinline, nothrow, cold, weak)) #else @@ -26,7 +26,7 @@ // To make the algorithms available for C and C++ in CUDA and OpenMP we select // different but equivalent function versions. TODO: For OpenMP we currently // select the native builtins as the overload support for templates is lacking. -#if !defined(_OPENMP) +#if !defined(__OPENMP_NVPTX__) #define _ISNANd std::isnan #define _ISNANf std::isnan #define _ISINFd std::isinf @@ -250,7 +250,7 @@ __DEVICE__ float _Complex __divsc3(float __a, float __b, float __c, float __d) { #undef _LOGBd #undef _LOGBf -#ifdef _OPENMP +#ifdef __OPENMP_NVPTX__ #pragma omp end declare target #endif diff --git a/lib/include/openmp_wrappers/complex b/lib/include/openmp_wrappers/complex index 1ed0b14879efb6bb102d13c9e41cfafc9755734f..d8dcd41670ee4ad3be3c4dbbaa32576f79af58ed 100644 --- a/lib/include/openmp_wrappers/complex +++ b/lib/include/openmp_wrappers/complex @@ -18,7 +18,9 @@ #include #define __CUDA__ +#define __OPENMP_NVPTX__ #include <__clang_cuda_complex_builtins.h> +#undef __OPENMP_NVPTX__ #endif // Grab the host header too. diff --git a/lib/include/openmp_wrappers/complex.h b/lib/include/openmp_wrappers/complex.h index 829c7a78572531a0b28067ca082198a561c57b6b..00d278548f826bc792794404bb1db23dd58e9d75 100644 --- a/lib/include/openmp_wrappers/complex.h +++ b/lib/include/openmp_wrappers/complex.h @@ -18,7 +18,9 @@ #include #define __CUDA__ +#define __OPENMP_NVPTX__ #include <__clang_cuda_complex_builtins.h> +#undef __OPENMP_NVPTX__ #endif // Grab the host header too. -- 2.54.0