diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index cc5e22d74..7b88bb412 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -357,28 +357,6 @@ #endif #endif -/// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture -/// supports Neon vector intrinsics for fp16. -#if EIGEN_ARCH_ARM_OR_ARM64 - #ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC - #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) - #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1 - #else - #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0 - #endif - #endif -#endif - -/// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture -/// supports Neon scalar intrinsics for fp16. -#if EIGEN_ARCH_ARM_OR_ARM64 - #ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC - #if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) - #define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1 - #endif - #endif -#endif - /// \internal EIGEN_ARCH_MIPS set to 1 if the architecture is MIPS #if defined(__mips__) || defined(__mips) #define EIGEN_ARCH_MIPS 1 @@ -637,6 +615,28 @@ // #endif +/// \internal EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC set to 1 if the architecture +/// supports Neon vector intrinsics for fp16. +#if EIGEN_ARCH_ARM_OR_ARM64 + #ifndef EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC + #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE) + #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 1 + #else + #define EIGEN_HAS_ARM64_FP16_VECTOR_ARITHMETIC 0 + #endif + #endif +#endif + +/// \internal EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC set to 1 if the architecture +/// supports Neon scalar intrinsics for fp16. +#if EIGEN_ARCH_ARM_OR_ARM64 + #ifndef EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC + #if defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && !defined(EIGEN_GPU_COMPILE_PHASE) + #define EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC 1 + #endif + #endif +#endif + #if defined(EIGEN_USE_SYCL) && defined(__SYCL_DEVICE_ONLY__) // EIGEN_USE_SYCL is a user-defined macro while __SYCL_DEVICE_ONLY__ is a compiler-defined macro. // In most cases we want to check if both macros are defined which can be done using the define below.