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