Fixes to support old and new versions of the compilers for built-ins. Cast to non-const when using vector_pair with certain built-ins.

This commit is contained in:
Chip-Kerchner 2021-02-24 14:46:04 -06:00 committed by Chip Kerchner
parent 5908aeeaba
commit 8523d447a1
2 changed files with 8 additions and 4 deletions

View File

@ -12,7 +12,7 @@
#include "MatrixProductCommon.h"
#if __GNUC__ > 10 || \
#if __GNUC__ > 10 || __clang_major__ > 11 || \
(__GNUC__ == 10 && (__GNUC_MINOR__ > 2 || \
(__GNUC_MINOR__ == 2 && \
__GNUC_PATCHLEVEL__ >= 1)))

View File

@ -12,6 +12,10 @@
#pragma GCC target("cpu=power10")
#if !__has_builtin(__builtin_vsx_assemble_pair)
#define __builtin_vsx_assemble_pair __builtin_mma_assemble_pair
#endif
namespace Eigen {
namespace internal {
@ -193,13 +197,13 @@ EIGEN_STRONG_INLINE void pgerMMA<Packet2d, PacketBlock<Packet2d, 2>, true>(__vec
template<>
EIGEN_STRONG_INLINE void pgerMMA<Packet2d, __vector_pair, false>(__vector_quad *acc, const __vector_pair& a, const Packet2d& b)
{
__builtin_mma_xvf64gerpp(acc, a, (__vector unsigned char)b);
__builtin_mma_xvf64gerpp(acc, (__vector_pair)a, (__vector unsigned char)b);
}
template<>
EIGEN_STRONG_INLINE void pgerMMA<Packet2d, __vector_pair, true>(__vector_quad *acc, const __vector_pair& a, const Packet2d& b)
{
__builtin_mma_xvf64gernp(acc, a, (__vector unsigned char)b);
__builtin_mma_xvf64gernp(acc, (__vector_pair)a, (__vector unsigned char)b);
}
template<>
@ -231,7 +235,7 @@ EIGEN_STRONG_INLINE void ploadRhsMMA<double, PacketBlock<Packet2d, 2> >(const do
template<>
EIGEN_STRONG_INLINE void ploadRhsMMA<double, __vector_pair>(const double *rhs, __vector_pair &rhsV)
{
__builtin_mma_assemble_pair(&rhsV, (__vector unsigned char)(*(((Packet2d *)rhs) + 1)), (__vector unsigned char)(*((Packet2d *)rhs)));
__builtin_vsx_assemble_pair(&rhsV, (__vector unsigned char)(*(((Packet2d *)rhs) + 1)), (__vector unsigned char)(*((Packet2d *)rhs)));
}
template<typename Scalar, typename Packet, typename DataMapper, typename Index, const Index accRows>