Fix supportsMMA to obey EIGEN_ALTIVEC_MMA_DYNAMIC_DISPATCH compilation flag and compiler support.

This commit is contained in:
Chip Kerchner 2023-06-28 17:57:21 +00:00 committed by Rasmus Munk Larsen
parent bc57b926a0
commit 3791ac8a1a

View File

@ -2714,10 +2714,10 @@ EIGEN_ALWAYS_INLINE bool supportsMMA()
#if defined(EIGEN_ALTIVEC_MMA_ONLY)
return true;
#else
#if EIGEN_COMP_LLVM
return false; // No dynamic dispatch for LLVM
#else
#if defined(EIGEN_ALTIVEC_MMA_DYNAMIC_DISPATCH) && __has_builtin(__builtin_cpu_supports)
return __builtin_cpu_supports ("arch_3_1") && __builtin_cpu_supports ("mma");
#else
return false; // No dynamic dispatch for LLVM
#endif
#endif
}