Don't try to enable use of ARM NEON intrinsics when compiling in CUDA device mode. They are not available in that configuration, even if the host supports them.

PiperOrigin-RevId: 468232254
Change-Id: I1cd26eda2962778b62135a31f477928c3bde1124
pull/1254/head
Abseil Team 2 years ago committed by Copybara-Service
parent fcfc7a6d15
commit e81f6ba042
  1. 7
      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 // ABSL_INTERNAL_HAVE_ARM_NEON is used for compile-time detection of NEON (ARM
// SIMD). // 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 #ifdef ABSL_INTERNAL_HAVE_ARM_NEON
#error ABSL_INTERNAL_HAVE_ARM_NEON cannot be directly set #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 #define ABSL_INTERNAL_HAVE_ARM_NEON 1
#endif #endif

Loading…
Cancel
Save