From 6d897e111a341420af9badae771517f979a76c4c Mon Sep 17 00:00:00 2001 From: Mark Gates Date: Thu, 30 May 2024 23:26:54 -0400 Subject: [PATCH] unit_test: test norm with small tile to avoid old LAPACK inaccuracy bug --- unit_test/test_norm.cc | 10 +++++++--- unit_test/unit_test.cc | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/unit_test/test_norm.cc b/unit_test/test_norm.cc index ce044eedb..9a978b91e 100644 --- a/unit_test/test_norm.cc +++ b/unit_test/test_norm.cc @@ -154,8 +154,8 @@ void test_genorm_dev(Norm norm) } double eps = std::numeric_limits::epsilon(); - int m = 3000; - int n = 3000; + int m = 20; + int n = 30; int lda = roundup(m, 8); double* Adata = new double[ lda * n ]; slate::Tile A(m, n, Adata, lda, -1, slate::TileKind::UserOwned); @@ -374,7 +374,11 @@ void test_synorm_dev(Norm norm, Uplo uplo) } double eps = std::numeric_limits::epsilon(); - int n = 3000; + + // Note: if testing with large n, some LAPACK versions have an + // inaccurate Frobenius lansy. If problems are encountered, + // verify with reference LAPACK >= v3.10.0. + int n = 30; int lda = roundup(n, 8); double* Adata = new double[ lda * n ]; slate::Tile A(n, n, Adata, lda, -1, slate::TileKind::UserOwned); diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index 892c9bcc1..5faadab1c 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -122,7 +122,7 @@ std::string output_fail( AssertError const& ex ) std::string output_skip( SkipException const& ex ) { return std::string( ansi_magenta ) + "skipped: " + ansi_normal - + ansi_gray + ex.what() + ansi_normal + "\n"; + + ansi_gray + ex.what() + ansi_normal; } //------------------------------------------------------------------------------