diff options
Diffstat (limited to 'absl/base')
-rw-r--r-- | absl/base/config.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/absl/base/config.h b/absl/base/config.h index 9626548c..95131068 100644 --- a/absl/base/config.h +++ b/absl/base/config.h @@ -915,9 +915,14 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM // SIMD). +// +// If __CUDA_ARCH__ is defined, then we are compiling CUDA code in device mode. +// In device mode, NEON intrinsics are not available, regardless of host +// platform. +// https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code #ifdef ABSL_INTERNAL_HAVE_ARM_NEON #error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set -#elif defined(__ARM_NEON) +#elif defined(__ARM_NEON) && !defined(__CUDA_ARCH__) #define ABSL_INTERNAL_HAVE_ARM_NEON 1 #endif |