diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h index 39bba577a..ebae1a34f 100644 --- a/Eigen/src/Core/GenericPacketMath.h +++ b/Eigen/src/Core/GenericPacketMath.h @@ -58,6 +58,9 @@ struct default_packet_traits HasConj = 1, HasSetLinear = 1, HasBlend = 0, + // This flag is used to indicate whether packet comparison is supported. + // pcmp_eq, pcmp_lt and pcmp_le should be defined for it to be true. + HasCmp = 0, HasDiv = 0, HasSqrt = 0, diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h index b27a62cbc..b17c34015 100644 --- a/Eigen/src/Core/arch/AVX/PacketMath.h +++ b/Eigen/src/Core/arch/AVX/PacketMath.h @@ -63,6 +63,7 @@ template<> struct packet_traits : default_packet_traits size = 8, HasHalfPacket = 1, + HasCmp = 1, HasDiv = 1, HasSin = EIGEN_FAST_MATH, HasCos = EIGEN_FAST_MATH, @@ -93,6 +94,7 @@ template<> struct packet_traits : default_packet_traits size=4, HasHalfPacket = 1, + HasCmp = 1, HasDiv = 1, HasExp = 1, HasSqrt = 1, diff --git a/Eigen/src/Core/arch/AVX512/PacketMath.h b/Eigen/src/Core/arch/AVX512/PacketMath.h index ed15e0889..f55a50596 100644 --- a/Eigen/src/Core/arch/AVX512/PacketMath.h +++ b/Eigen/src/Core/arch/AVX512/PacketMath.h @@ -103,6 +103,7 @@ template<> struct packet_traits : default_packet_traits HasTanh = EIGEN_FAST_MATH, HasErf = EIGEN_FAST_MATH, #endif + HasCmp = 1, HasDiv = 1 }; }; @@ -119,6 +120,7 @@ template<> struct packet_traits : default_packet_traits HasSqrt = EIGEN_FAST_MATH, HasRsqrt = EIGEN_FAST_MATH, #endif + HasCmp = 1, HasDiv = 1 }; }; @@ -1656,6 +1658,7 @@ struct packet_traits : default_packet_traits { HasTanh = EIGEN_FAST_MATH, HasErf = EIGEN_FAST_MATH, #endif + HasCmp = 1, HasDiv = 1 }; }; diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h index 9f2e922a2..1d640cf76 100755 --- a/Eigen/src/Core/arch/SSE/PacketMath.h +++ b/Eigen/src/Core/arch/SSE/PacketMath.h @@ -94,6 +94,7 @@ struct packet_traits : default_packet_traits { size = 4, HasHalfPacket = 0, + HasCmp = 1, HasDiv = 1, HasSin = EIGEN_FAST_MATH, HasCos = EIGEN_FAST_MATH, @@ -128,6 +129,7 @@ struct packet_traits : default_packet_traits { size=2, HasHalfPacket = 0, + HasCmp = 1, HasDiv = 1, HasExp = 1, HasSqrt = 1, diff --git a/Eigen/src/Core/functors/BinaryFunctors.h b/Eigen/src/Core/functors/BinaryFunctors.h index 54bcddd34..d8b7b1eba 100644 --- a/Eigen/src/Core/functors/BinaryFunctors.h +++ b/Eigen/src/Core/functors/BinaryFunctors.h @@ -260,7 +260,7 @@ template struct functor_traits > { enum { Cost = (NumTraits::AddCost+NumTraits::AddCost)/2, - PacketAccess = internal::is_same::value && internal::is_same::value + PacketAccess = internal::is_same::value && packet_traits::HasCmp }; };