From 23bd04eae9b43a958334db7699227ceaca41db3d Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 15 Feb 2018 04:07:01 +0000 Subject: [PATCH] Check sum with 2% error instead of abs error. This seems to help validate single precision runs where the sum is as close as we can expect for these large arrays. --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 4fd5125a..0dab86b8 100644 --- a/main.cpp +++ b/main.cpp @@ -425,10 +425,10 @@ void check_solution(const unsigned int ntimes, std::vector& a, std::vector std::cerr << "Validation failed on c[]. Average error " << errC << std::endl; - // Check sum to 8 decimal places - if (!triad_only && errSum > 1.0E-8) + // Check percentage error of sum. Should be within 2%. + if (!triad_only && errSum/goldSum > 2.0E-2) std::cerr - << "Validation failed on sum. Error " << errSum + << "Validation failed on sum. Percentage error " << errSum/goldSum * 100.0 << std::endl << std::setprecision(15) << "Sum was " << sum << " but should be " << goldSum << std::endl;