aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Chip-Kerchner <chip.kerchner@ibm.com>2021-02-24 20:43:23 -0600
committerGravatar Chip-Kerchner <chip.kerchner@ibm.com>2021-02-24 20:43:23 -0600
commit6eebe97babeb861cff713ec290ba9c7dec89b865 (patch)
tree4e2d57a0f407e701b8f6c781d002d1bfdd18ed18 /Eigen
parentf284c8592b279d5e796842f662927c86c6bdc185 (diff)
Fix clang compile when no MMA flags are set. Simplify MMA compiler detection.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/arch/AltiVec/MatrixProduct.h17
-rw-r--r--Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
index 89d81e06f..03d474a70 100644
--- a/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
+++ b/Eigen/src/Core/arch/AltiVec/MatrixProduct.h
@@ -12,12 +12,21 @@
#include "MatrixProductCommon.h"
-#if __GNUC__ > 10 || __clang_major__ > 11 || \
- (__GNUC__ == 10 && (__GNUC_MINOR__ > 2 || \
- (__GNUC_MINOR__ == 2 && \
- __GNUC_PATCHLEVEL__ >= 1)))
+#if EIGEN_COMP_LLVM
+#if !defined(EIGEN_ALTIVEC_DISABLE_MMA) && !defined(EIGEN_ALTIVEC_MMA_ONLY)
+#ifdef __MMA__
+#define EIGEN_ALTIVEC_MMA_ONLY
+#else
+#define EIGEN_ALTIVEC_DISABLE_MMA
+#endif
+#endif
+#endif
+
+#ifdef __has_builtin
+#if __has_builtin(__builtin_mma_assemble_acc)
#define ALTIVEC_MMA_SUPPORT
#endif
+#endif
#if defined(ALTIVEC_MMA_SUPPORT) && !defined(EIGEN_ALTIVEC_DISABLE_MMA)
#include "MatrixProductMMA.h"
diff --git a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
index bfee9ee92..37db1a6f1 100644
--- a/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
+++ b/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h
@@ -12,9 +12,11 @@
#pragma GCC target("cpu=power10")
+#ifdef __has_builtin
#if !__has_builtin(__builtin_vsx_assemble_pair)
#define __builtin_vsx_assemble_pair __builtin_mma_assemble_pair
#endif
+#endif
namespace Eigen {