From d43b2f01f48d67507b921b8f9ee1fca071ac2ee2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 3 Apr 2018 14:14:00 +0200 Subject: Fix unit testing of predux_downto4 (bad name), and add unit testing of prsqrt --- test/packetmath.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 3c11df7e8..31a524af3 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -248,12 +248,13 @@ template void packetmath() VERIFY(isApproxAbs(ref[0], internal::predux(internal::pload(data1)), refvalue) && "internal::predux"); { - for (int i=0; i<4; ++i) + int HalfPacketSize = PacketSize>4 ? PacketSize/2 : PacketSize; + for (int i=0; i(data1))); - VERIFY(areApprox(ref, data2, PacketSize>4?PacketSize/2:PacketSize) && "internal::predux_downto4"); + VERIFY(areApprox(ref, data2, HalfPacketSize) && "internal::predux_downto4"); } ref[0] = 1; @@ -436,6 +437,7 @@ template void packetmath_real() if(internal::random(0,1)<0.1f) data1[internal::random(0, PacketSize)] = 0; CHECK_CWISE1_IF(PacketTraits::HasSqrt, std::sqrt, internal::psqrt); + CHECK_CWISE1_IF(PacketTraits::HasSqrt, Scalar(1)/std::sqrt, internal::prsqrt); CHECK_CWISE1_IF(PacketTraits::HasLog, std::log, internal::plog); #if EIGEN_HAS_C99_MATH && (__cplusplus > 199711L) CHECK_CWISE1_IF(PacketTraits::HasExpm1, std::expm1, internal::pexpm1); -- cgit v1.2.3