Normalise sum result to mitigate errors with large iteration counts

This commit is contained in:
Tom Deakin 2021-02-03 10:16:13 +00:00
parent 210cfb7520
commit 579247dc06
2 changed files with 2 additions and 1 deletions

View File

@ -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.

View File

@ -496,7 +496,7 @@ void check_solution(const unsigned int ntimes, std::vector<T>& a, std::vector<T>
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<T>::epsilon() * 100.0;