From 17d57fb168ac1463736ee1f4c13c9487684146b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Wed, 16 Mar 2022 19:16:28 +0000 Subject: [PATCH] Fix up PowerPC MMA flags so it builds by default. (cherry picked from commit 591906477bc8c8102dbefceefe10d81648865394) --- Eigen/src/Core/arch/AltiVec/MatrixProduct.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h index 1888347b1..ea7749610 100644 --- a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +++ b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h @@ -17,8 +17,12 @@ #include "MatrixProductCommon.h" +#if !defined(EIGEN_ALTIVEC_DISABLE_MMA) +#define EIGEN_ALTIVEC_DISABLE_MMA 0 +#endif + // Check for MMA builtin support. -#if !defined(EIGEN_ALTIVEC_DISABLE_MMA) && defined(__has_builtin) +#if !EIGEN_ALTIVEC_DISABLE_MMA && defined(__has_builtin) #if __has_builtin(__builtin_mma_assemble_acc) #define EIGEN_ALTIVEC_MMA_SUPPORT #endif @@ -27,12 +31,16 @@ // Check if and how we should actually use MMA if supported. #if defined(EIGEN_ALTIVEC_MMA_SUPPORT) -// Use MMA by default if available. -#if defined(__MMA__) -#define EIGEN_ALTIVEC_MMA_ONLY 1 -// Otherwise, check if we want to enable dynamic dispatch. Not supported by LLVM. -#elif defined(EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH) && !defined(EIGEN_COMP_LLVM) +#if !defined(EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH) +#define EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH 0 +#endif + +// Check if we want to enable dynamic dispatch. Not supported by LLVM. +#if EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH && !EIGEN_COMP_LLVM #define EIGEN_ALTIVEC_MMA_DYNAMIC_DISPATCH 1 +// Otherwise, use MMA by default if available. +#elif defined(__MMA__) +#define EIGEN_ALTIVEC_MMA_ONLY 1 #endif #endif // EIGEN_ALTIVEC_MMA_SUPPORT