https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108608

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The original code in kokkos had roughly:
  Real max_rel_err = -1;
  const Real rel_tol = std::numeric_limits<Real>::epsilon();


  for (int n = 0; n < N; n++) {
    for (int k = 0; k < N; k++) {
      for (int j = 0; j < N; j++) {
        for (int i = 1; i < N - 1; i++) {
          const Real analytic = 2.0 * (i + 1) * pow((j + 2) * (k + 3) * (n +
4), 2.0);
          const Real err = host_du(n, k, j, i - 1) - analytic;

          max_rel_err = fmax(fabs(err / analytic), max_rel_err);
        }
      }
    }
  }

  return max_rel_err < rel_tol;
where Real is double, and host_du is some hard to decipher C++ object.

Reply via email to