From 62f948c56a782689947e4bbdcaab2b5cb0247ac5 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 9 Jul 2014 16:01:24 +0200 Subject: [PATCH] Generalize unit testing of pscatter --- test/packetmath.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index a51d31dbd..e5dc473c2 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -408,14 +408,17 @@ template void packetmath_scatter_gather() { for (int i=0; i()/RealScalar(PacketSize); } - EIGEN_ALIGN_DEFAULT Scalar buffer[PacketSize*11]; - memset(buffer, 0, 11*sizeof(Packet)); + + int stride = internal::random(1,20); + + EIGEN_ALIGN_DEFAULT Scalar buffer[PacketSize*20]; + memset(buffer, 0, 20*sizeof(Packet)); Packet packet = internal::pload(data1); - internal::pscatter(buffer, packet, 11); + internal::pscatter(buffer, packet, stride); - for (int i = 0; i < PacketSize*11; ++i) { - if ((i%11) == 0) { - VERIFY(isApproxAbs(buffer[i], data1[i/11], refvalue) && "pscatter"); + for (int i = 0; i < PacketSize*20; ++i) { + if ((i%stride) == 0 && i