From fecfa7f27e450464e59b7befeed4bb755fa89f4e Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Thu, 6 Nov 2025 22:50:32 +0000 Subject: [PATCH] Fixes to make generic backend build with AVX512 See merge request libeigen/eigen!2064 Co-authored-by: Rasmus Munk Larsen --- Eigen/Core | 2 ++ Eigen/src/Core/arch/AVX512/Complex.h | 2 +- Eigen/src/Core/arch/clang/PacketMath.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index 93e7f5570..59f12eb54 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -415,6 +415,7 @@ using std::ptrdiff_t; #include "src/Core/CoreIterators.h" #include "src/Core/ConditionEstimator.h" +#if !defined(EIGEN_VECTORIZE_GENERIC) #if defined(EIGEN_VECTORIZE_VSX) #include "src/Core/arch/AltiVec/MatrixProduct.h" #elif defined EIGEN_VECTORIZE_NEON @@ -426,6 +427,7 @@ using std::ptrdiff_t; #if defined(EIGEN_VECTORIZE_AVX512) #include "src/Core/arch/AVX512/GemmKernel.h" #endif +#endif #include "src/Core/Select.h" #include "src/Core/VectorwiseOp.h" diff --git a/Eigen/src/Core/arch/AVX512/Complex.h b/Eigen/src/Core/arch/AVX512/Complex.h index b70c7fefe..b9b49534d 100644 --- a/Eigen/src/Core/arch/AVX512/Complex.h +++ b/Eigen/src/Core/arch/AVX512/Complex.h @@ -184,7 +184,7 @@ EIGEN_STRONG_INLINE std::complex predux_mul(const Packet8cf& a } template <> -EIGEN_STRONG_INLINE Packet4cf predux_half_dowto4(const Packet8cf& a) { +EIGEN_STRONG_INLINE Packet4cf predux_half(const Packet8cf& a) { __m256 lane0 = extract256<0>(a.v); __m256 lane1 = extract256<1>(a.v); __m256 res = _mm256_add_ps(lane0, lane1); diff --git a/Eigen/src/Core/arch/clang/PacketMath.h b/Eigen/src/Core/arch/clang/PacketMath.h index 3524ad653..359f1e4d3 100644 --- a/Eigen/src/Core/arch/clang/PacketMath.h +++ b/Eigen/src/Core/arch/clang/PacketMath.h @@ -541,7 +541,7 @@ EIGEN_CLANG_PACKET_MATH_FLOAT(Packet8d) #endif // --- Fused Multiply-Add (MADD) --- -#if defined(EIGEN_VECTORIZE_FMA) && __has_builtin(__builtin_elementwise_fma) +#if defined(__FMA__) && __has_builtin(__builtin_elementwise_fma) #define EIGEN_CLANG_PACKET_MADD(PACKET_TYPE) \ template <> \ EIGEN_STRONG_INLINE PACKET_TYPE pmadd(const PACKET_TYPE& a, const PACKET_TYPE& b, \