From 0642478668b039d2c054965908ada698736760bc Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 14 Mar 2016 15:07:20 -0400 Subject: [PATCH] Correct implicit function test failures when vectorization is enabled. When vectorization is enabled we start using 'fast' math, and therefore instead of getting perfect 0.0 values we get values that are extremely close to zero. --- vtkm/testing/TestingImplicitFunctions.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vtkm/testing/TestingImplicitFunctions.h b/vtkm/testing/TestingImplicitFunctions.h index 19c301ab2..d4c7171b3 100644 --- a/vtkm/testing/TestingImplicitFunctions.h +++ b/vtkm/testing/TestingImplicitFunctions.h @@ -106,10 +106,11 @@ struct TestingImplicitFunctions vtkm::cont::ArrayHandle::PortalConstControl portal = values.GetPortalConstControl(); + bool success = (portal.Get(0) == -(r*r)) && - (portal.Get(1) == 0.0) && - (portal.Get(2) == 0.0) && - (portal.Get(4) == 0.0) && + test_equal(portal.Get(1), FloatDefault(0.0) ) && + test_equal(portal.Get(2), FloatDefault(0.0) ) && + test_equal(portal.Get(4), FloatDefault(0.0) ) && (portal.Get(3) > 0.0) && (portal.Get(5) > 0.0) && (portal.Get(6) > 0.0) && @@ -144,7 +145,7 @@ struct TestingImplicitFunctions values.GetPortalConstControl(); bool success = (portal.Get(0) < 0.0) && (portal.Get(1) < 0.0) && - (portal.Get(2) == 0.0) && + test_equal(portal.Get(2), FloatDefault(0.0) ) && (portal.Get(3) > 0.0) && (portal.Get(4) > 0.0);