Skip to content

Commit

Permalink
Lapack - SVD: picking unit-test tolerance based on matrix size.
Browse files Browse the repository at this point in the history
This should make the test more stable overall as the accuracy of
the triple matrix check will degrade based on hom many FLOPs it
need to perform.
  • Loading branch information
lucbv committed Feb 1, 2024
1 parent 8efb8c2 commit 9dde102
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lapack/unit_test/Test_Lapack_svd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ int impl_test_svd(const int m, const int n) {
using vector_type =
Kokkos::View<mag_type*, typename AMatrix::array_layout, Device>;

std::cout << "Running impl_test_svd with sizes: " << m << "x" << n << std::endl;

const mag_type tol = 1000 * KAT_S::eps();

AMatrix A("A", m, n), U("U", m, m), Vt("Vt", n, n), Aref("A ref", m, n);
Expand All @@ -496,7 +498,7 @@ int impl_test_svd(const int m, const int n) {

// For larger sizes with the triple product
// we accumulate a bit more error apparently?
check_triple_product(Aref, S, U, Vt, 1000 * tol);
check_triple_product(Aref, S, U, Vt, 100 * Kokkos::max(m, n) * tol);

return 0;
}
Expand Down

0 comments on commit 9dde102

Please sign in to comment.