Fix up PowerPC MMA flags so it builds by default.

(cherry picked from commit 591906477bc8c8102dbefceefe10d81648865394)
This commit is contained in:
Antonio Sánchez 2022-03-16 19:16:28 +00:00 committed by Antonio Sanchez
parent 6973687c70
commit 17d57fb168

View File

@ -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