Skip to content

Commit 18deb88

Browse files
author
Anonymous
authored
Resolve internal issue #553: Allow for a tolerance in error checking in ALP gemm unit test (#91)
1 parent 57e1372 commit 18deb88

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unit/alp_gemm.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
using namespace alp;
2828

29+
static double tol = 1.e-7;
30+
2931
/**
3032
* Initializes matrix elements to random values between 0 and 1.
3133
* Assumes the matrix uses full storage.
@@ -199,7 +201,7 @@ void alp_program( const size_t &unit, alp::RC &rc ) {
199201
const auto calculated_value = alp::internal::access( C, alp::internal::getStorageIndex( C, i, j ) );
200202

201203
// Compare and report
202-
if( expected_value != calculated_value ) {
204+
if( std::abs( expected_value - calculated_value ) > tol ) {
203205
#ifndef NDEBUG
204206
std::cerr << "Numerically incorrect: "
205207
"at (" << i << ", " << j << ") "

0 commit comments

Comments
 (0)