diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h index adf431b4c..7f35b3114 100644 --- a/Eigen/src/Core/GenericPacketMath.h +++ b/Eigen/src/Core/GenericPacketMath.h @@ -524,7 +524,8 @@ template EIGEN_DEVICE_FUNC inline bool predux_any(const Packet& // - bits full of ones (NaN for floats), // - or first bit equals to 1 (1 for ints, smallest denormal for floats). // For all these cases, taking the sum is just fine, and this boils down to a no-op for scalars. - return bool(numext::not_equal_strict(predux(a), pzero(a))); + typedef typename unpacket_traits::type Scalar; + return numext::not_equal_strict(predux(a), Scalar(0)); } /** \internal \returns the reversed elements of \a a*/ diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 032c0e4c8..540cf6a86 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -447,18 +447,20 @@ template void packetmath_real() VERIFY((numext::isnan)(data2[0])); } - { + if (PacketTraits::HasExp) { internal::scalar_logistic_op logistic; for (int i=0; i(-20,20); } - internal::pstore(data2, logistic.packetOp(internal::pload(data1))); + + test::packet_helper h; + h.store(data2, logistic.packetOp(h.load(data1))); for (int i=0; i