Change EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH and EIGEN_ALTIVEC_DISABLE_MMA flags to be like TensorFlow's...

This commit is contained in:
Chip Kerchner
2022-03-17 22:35:27 +00:00
committed by Antonio Sánchez
parent 3ca1228d45
commit 7b10795e39
3 changed files with 15 additions and 5 deletions

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,9 +31,12 @@
// Check if and how we should actually use MMA if supported.
#if defined(EIGEN_ALTIVEC_MMA_SUPPORT)
#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 defined(EIGEN_ALTIVEC_ENABLE_MMA_DYNAMIC_DISPATCH) && !EIGEN_COMP_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__)

View File

@@ -12,7 +12,7 @@
#include "../../InternalHeaderCheck.h"
#if defined(__MMA__) && !defined(EIGEN_ALTIVEC_DISABLE_MMA)
#if defined(__MMA__) && !EIGEN_ALTIVEC_DISABLE_MMA
#if EIGEN_COMP_LLVM || (__GNUC__ > 10 || __GNUC_MINOR__ >= 3)
#define USE_GEMV_MMA
#endif