Ensure EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC is always defined on arm.

(cherry picked from commit 31cd2ad371bf8b7486951dfcd20381427aba5546)
This commit is contained in:
Antonio Sánchez 2023-06-26 19:21:54 +00:00 committed by Antonio Sanchez
parent e6e921f0e3
commit 33ba98b641

View File

@ -545,9 +545,11 @@
/// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture /// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture
/// supports Neon vector intrinsics for fp16. /// supports Neon vector intrinsics for fp16.
#if EIGEN_ARCH_ARM64 #if EIGEN_ARCH_ARM_OR_ARM64
#ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC #ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC
#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE) // Clang only supports FP16 on aarch64, and not all intrinsics are available
// on A32 anyways even in GCC (e.g. vdiv_f16, vsqrt_f16).
#if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
#define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1 #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1
#else #else
#define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0 #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0
@ -557,9 +559,11 @@
/// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture /// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture
/// supports Neon scalar intrinsics for fp16. /// supports Neon scalar intrinsics for fp16.
#if EIGEN_ARCH_ARM64 #if EIGEN_ARCH_ARM_OR_ARM64
#ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC #ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC
#if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE) // Clang only supports FP16 on aarch64, and not all intrinsics are available
// on A32 anyways, even in GCC (e.g. vceqh_f16).
#if EIGEN_ARCH_ARM64 && defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE)
#define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1 #define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1
#endif #endif
#endif #endif