diff --git a/CHANGELOG.md b/CHANGELOG.md index 42dfed8..7611fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file. - Clang compiler OpenMP flags corrected for NVIDIA target. - Reorder OpenCL objects in class so destructors are called in safe order. - Ensure all OpenCL kernels are present in destructor. +- Normalise sum result by expected value to help false negative errors. ### Removed - Pre-building of kernels in SYCL version to ensure compatibility with SYCL 1.2.1. diff --git a/main.cpp b/main.cpp index 5b931f7..302521f 100644 --- a/main.cpp +++ b/main.cpp @@ -496,7 +496,7 @@ void check_solution(const unsigned int ntimes, std::vector& a, std::vector errB /= b.size(); double errC = std::accumulate(c.begin(), c.end(), 0.0, [&](double sum, const T val){ return sum + fabs(val - goldC); }); errC /= c.size(); - double errSum = fabs(sum - goldSum); + double errSum = fabs((sum - goldSum)/goldSum); double epsi = std::numeric_limits::epsilon() * 100.0;