GTestSuite: print name of variable in error messages

Add name of variable being tested in error output from
computediff functions. First step to adding (optional)
tests on input arguments.

AMD-Internal: [CPUPL-4379]
Change-Id: I9553b660bcf5ecf1dd675cb837655078933455ac
This commit is contained in:
Edward Smyth
2024-04-04 08:56:33 -04:00
parent 7bb82eee6e
commit 1ef7fb428a
76 changed files with 333 additions and 279 deletions

View File

@@ -73,7 +73,7 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_transa)
// Call imatcopy with a invalid value for TRANS value for the operation.
imatcopy<T>( 'Q', M, N, alpha, A.data(), LDA, LDA );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, A.data(), A_ref.data(), LDA );
computediff<T>( "A", 'c', M, N, A.data(), A_ref.data(), LDA );
}
// When m < 0
@@ -91,7 +91,7 @@ TYPED_TEST(imatcopy_IIT_ERS, m_lt_zero)
// Call imatcopy with a invalid m for the operation.
imatcopy<T>( TRANS, -1, N, alpha, A.data(), LDA, LDA );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, A.data(), A_ref.data(), LDA );
computediff<T>( "A", 'c', M, N, A.data(), A_ref.data(), LDA );
}
// When n < 0
@@ -109,7 +109,7 @@ TYPED_TEST(imatcopy_IIT_ERS, n_lt_zero)
// Call imatcopy with a invalid n for the operation.
imatcopy<T>( TRANS, M, -1, alpha, A.data(), LDA, LDA );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, A.data(), A_ref.data(), LDA );
computediff<T>( "A", 'c', M, N, A.data(), A_ref.data(), LDA );
}
// When lda < m
@@ -131,7 +131,7 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_lda_in)
// Call imatcopy with a invalid lda for the operation.
imatcopy<T>( 'n', m, n, alpha, A.data(), m - 1, m );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, A.data(), A_ref.data(), m );
computediff<T>( "A", 'c', m, n, A.data(), A_ref.data(), m );
}
// When lda_out < m, with trans == 'n'
@@ -153,7 +153,7 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_lda_out_no_transpose)
// Call imatcopy with a invalid lda for the operation.
imatcopy<T>( 'n', m, n, alpha, A.data(), m, m-1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, A.data(), A_ref.data(), m );
computediff<T>( "A", 'c', m, n, A.data(), A_ref.data(), m );
}
// When lda_out < m, with trans == 'r'
@@ -175,7 +175,7 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_lda_out_conjugate)
// Call imatcopy with a invalid lda for the operation.
imatcopy<T>( 'r', m, n, alpha, A.data(), m, m-1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, A.data(), A_ref.data(), m );
computediff<T>( "A", 'c', m, n, A.data(), A_ref.data(), m );
}
// When lda_out < m, with trans == 't'
@@ -197,7 +197,7 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_lda_out_transpose)
// Call imatcopy with a invalid lda for the operation.
imatcopy<T>( 'n', m, n, alpha, A.data(), m, n-1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, A.data(), A_ref.data(), m );
computediff<T>( "A", 'c', m, n, A.data(), A_ref.data(), m );
}
// When lda_out < m, with trans == 'c'
@@ -219,6 +219,6 @@ TYPED_TEST(imatcopy_IIT_ERS, invalid_lda_out_conjugate_transpose)
// Call imatcopy with a invalid lda for the operation.
imatcopy<T>( 'n', m, n, alpha, A.data(), m, n-1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, A.data(), A_ref.data(), m );
computediff<T>( "A", 'c', m, n, A.data(), A_ref.data(), m );
}
#endif

View File

@@ -134,8 +134,8 @@ static void test_imatcopy( char storage, char trans, gtint_t m, gtint_t n, T alp
//----------------------------------------------------------
if( A_out_trans == 'n' )
computediff<T>( storage, m, n, A, A_ref, lda_out, thresh, is_nan_inf_test );
computediff<T>( "A", storage, m, n, A, A_ref, lda_out, thresh, is_nan_inf_test );
else
computediff<T>( storage, n, m, A, A_ref, lda_out, thresh, is_nan_inf_test );
computediff<T>( "A", storage, n, m, A, A_ref, lda_out, thresh, is_nan_inf_test );
}

View File

@@ -74,7 +74,7 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_transa)
// Call OMATCOPY with a invalid value for TRANS value for the operation.
omatcopy<T>( 'Q', M, N, alpha, A.data(), LDA, B.data(), LDB);
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When m < 0
@@ -93,7 +93,7 @@ TYPED_TEST(omatcopy_IIT_ERS, m_lt_zero)
// Call OMATCOPY with a invalid m for the operation.
omatcopy<T>( TRANS, -1, N, alpha, A.data(), LDA, B.data(), LDB);
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When n < 0
@@ -112,7 +112,7 @@ TYPED_TEST(omatcopy_IIT_ERS, n_lt_zero)
// Call OMATCOPY with a invalid n for the operation.
omatcopy<T>( TRANS, M, -1, alpha, A.data(), LDA, B.data(), LDB);
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When lda < m
@@ -136,7 +136,7 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_lda)
// Call OMATCOPY with a invalid lda for the operation.
omatcopy<T>( 'n', m, n, alpha, A.data(), m - 1, B.data(), m);
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When ldb < m, with trans == 'n'
@@ -161,7 +161,7 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_ldb_no_transpose)
// Call OMATCOPY with a invalid ldb for the operation.
omatcopy<T>( trans, m, n, alpha, A.data(), m, B.data(), m - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When ldb < m, with trans == 'r'
@@ -186,7 +186,7 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_ldb_conjugate)
// Call OMATCOPY with a invalid ldb for the operation.
omatcopy<T>( trans, m, n, alpha, A.data(), m, B.data(), m - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When ldb < m, with trans == 't'
@@ -211,7 +211,7 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_ldb_transpose)
// Call OMATCOPY with a invalid ldb for the operation.
omatcopy<T>( trans, m, n, alpha, A.data(), m, B.data(), n - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', n, m, B.data(), B_ref.data(), n );
computediff<T>( "B", 'c', n, m, B.data(), B_ref.data(), n );
}
// When ldb < m, with trans == 'c'
@@ -236,6 +236,6 @@ TYPED_TEST(omatcopy_IIT_ERS, invalid_ldb_conjugate_transpose)
// Call OMATCOPY with a invalid ldb for the operation.
omatcopy<T>( trans, m, n, alpha, A.data(), m, B.data(), n - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', n, m, B.data(), B_ref.data(), n );
computediff<T>( "B", 'c', n, m, B.data(), B_ref.data(), n );
}
#endif

View File

@@ -136,9 +136,9 @@ static void test_omatcopy( char storage, char trans, gtint_t m, gtint_t n, T alp
//----------------------------------------------------------
if( B_trans == 'n' )
computediff<T>( storage, m, n, B, B_ref, ldb, thresh, is_nan_inf_test );
computediff<T>( "B", storage, m, n, B, B_ref, ldb, thresh, is_nan_inf_test );
else
computediff<T>( storage, n, m, B, B_ref, ldb, thresh, is_nan_inf_test );
computediff<T>( "B", storage, n, m, B, B_ref, ldb, thresh, is_nan_inf_test );
}

View File

@@ -76,7 +76,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_transa)
// Call OMATCOPY2 with a invalid value for TRANS value for the operation.
omatcopy2<T>( 'Q', M, N, alpha, A.data(), LDA, 1, B.data(), LDB, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When m < 0
@@ -95,7 +95,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, m_lt_zero)
// Call OMATCOPY2 with a invalid m for the operation.
omatcopy2<T>( TRANS, -1, N, alpha, A.data(), LDA, 1, B.data(), LDB, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When n < 0
@@ -114,7 +114,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, n_lt_zero)
// Call OMATCOPY2 with a invalid n for the operation.
omatcopy2<T>( TRANS, M, -1, alpha, A.data(), LDA, 1, B.data(), LDB, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When lda < m
@@ -138,7 +138,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_lda)
// Call OMATCOPY2 with a invalid lda for the operation.
omatcopy2<T>( 'n', m, n, alpha, A.data(), m - 1, 1, B.data(), m, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When stridea < 1
@@ -157,7 +157,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_stridea)
// Call OMATCOPY2 with a invalid n for the operation.
omatcopy2<T>( TRANS, M, N, alpha, A.data(), LDA, 0, B.data(), LDB, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
// When ldb < m, with trans == 'n'
@@ -182,7 +182,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_ldb_no_transpose)
// Call OMATCOPY2 with a invalid ldb for the operation.
omatcopy2<T>( trans, m, n, alpha, A.data(), m, 1, B.data(), m - 1, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When ldb < m, with trans == 'r'
@@ -207,7 +207,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_ldb_conjugate)
// Call OMATCOPY2 with a invalid ldb for the operation.
omatcopy2<T>( trans, m, n, alpha, A.data(), m, 1, B.data(), m - 1, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', m, n, B.data(), B_ref.data(), m );
computediff<T>( "B", 'c', m, n, B.data(), B_ref.data(), m );
}
// When ldb < m, with trans == 't'
@@ -232,7 +232,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_ldb_transpose)
// Call OMATCOPY2 with a invalid ldb for the operation.
omatcopy2<T>( trans, m, n, alpha, A.data(), m, 1, B.data(), n - 1, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', n, m, B.data(), B_ref.data(), n );
computediff<T>( "B", 'c', n, m, B.data(), B_ref.data(), n );
}
// When ldb < m, with trans == 'c'
@@ -257,7 +257,7 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_ldb_conjugate_transpose)
// Call OMATCOPY2 with a invalid ldb for the operation.
omatcopy2<T>( trans, m, n, alpha, A.data(), m, 1, B.data(), n - 1, 1 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', n, m, B.data(), B_ref.data(), n );
computediff<T>( "B", 'c', n, m, B.data(), B_ref.data(), n );
}
// When strideb < 1
@@ -276,6 +276,6 @@ TYPED_TEST(omatcopy2_IIT_ERS, invalid_strideb)
// Call OMATCOPY2 with a invalid n for the operation.
omatcopy2<T>( TRANS, M, N, alpha, A.data(), LDA, 1, B.data(), LDB, 0 );
// Use bitwise comparison (no threshold).
computediff<T>( 'c', M, N, B.data(), B_ref.data(), LDB );
computediff<T>( "B", 'c', M, N, B.data(), B_ref.data(), LDB );
}
#endif

View File

@@ -136,9 +136,9 @@ static void test_omatcopy2( char storage, char trans, gtint_t m, gtint_t n, T al
//----------------------------------------------------------
if( B_trans == 'n' )
computediff<T>( storage, m, n, B, B_ref, ldb, thresh, is_nan_inf_test );
computediff<T>( "B", storage, m, n, B, B_ref, ldb, thresh, is_nan_inf_test );
else
computediff<T>( storage, n, m, B, B_ref, ldb, thresh, is_nan_inf_test );
computediff<T>( "B", storage, n, m, B, B_ref, ldb, thresh, is_nan_inf_test );
}

View File

@@ -227,17 +227,21 @@ testing::AssertionResult NumericalComparisonInf(const char* blis_sol_char,
return testing::AssertionFailure() << error_message;
}
// Comparisons that take into account the presence of NaNs and Infs:
// Comparisons that take into account the presence of NaNs and Infs, printing variable name:
template<typename T, typename RT = typename testinghelpers::type_info<T>::real_type>
testing::AssertionResult NumericalComparison(const char* blis_sol_char,
testing::AssertionResult NumericalComparison(const char* var_name_char,
const char* blis_sol_char,
const char* ref_sol_char,
const char* comp_helper_char,
std::string var_name,
const T blis_sol,
const T ref_sol,
const ComparisonHelper comp_helper)
{
// Base error message used for scalar values
std::string error_message = blis_sol_char;
std::string error_message = var_name_char;
error_message += " = " + var_name + ", ";
error_message += blis_sol_char;
error_message += " = " + testinghelpers::to_string(blis_sol) + ", ";
error_message += ref_sol_char;
error_message += " = " + testinghelpers::to_string(ref_sol);
@@ -293,34 +297,34 @@ testing::AssertionResult NumericalComparison(const char* blis_sol_char,
}
/**
* Binary comparison of two scalars.
* Binary comparison of two scalars, printing variable name.
*/
template <typename T>
void computediff( T blis_sol, T ref_sol, bool nan_inf_check = false )
void computediff( std::string var_name, T blis_sol, T ref_sol, bool nan_inf_check = false )
{
ComparisonHelper comp_helper(SCALAR);
comp_helper.binary_comparison = true;
comp_helper.nan_inf_check = nan_inf_check;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol, ref_sol, comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol, ref_sol, comp_helper);
}
/**
* Relative comparison of two scalars, using a threshold.
* Relative comparison of two scalars, using a threshold, printing variable name.
*/
template <typename T>
void computediff( T blis_sol, T ref_sol, double thresh, bool nan_inf_check = false )
void computediff( std::string var_name, T blis_sol, T ref_sol, double thresh, bool nan_inf_check = false )
{
ComparisonHelper comp_helper(SCALAR, thresh);
comp_helper.nan_inf_check = nan_inf_check;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol, ref_sol, comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol, ref_sol, comp_helper);
}
/**
* Binary comparison of two vectors with length n and increment inc.
* Binary comparison of two vectors with length n and increment inc, printing variable name.
*/
template <typename T>
void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, bool nan_inf_check = false )
void computediff( std::string var_name, gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, bool nan_inf_check = false )
{
gtint_t abs_inc = std::abs(inc);
ComparisonHelper comp_helper(VECTOR);
@@ -332,21 +336,22 @@ void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, bool nan_inf_
for (gtint_t i = 0; i < n; i++)
{
comp_helper.i = i;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*abs_inc], ref_sol[i*abs_inc], comp_helper) << "inc = " << inc;
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*abs_inc], ref_sol[i*abs_inc], comp_helper) << "inc = " << inc;
// Go through elements that are part of the array that should not have been modified by the
// call to a BLIS API. Use the bitwise comparison for this case.
if (i < n-1)
{
for (gtint_t j = 1; j < abs_inc; j++)
{
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*abs_inc + j], ref_sol[i*abs_inc + j], comp_helper) << "inc = " << inc << " This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*abs_inc + j], ref_sol[i*abs_inc + j], comp_helper) << "inc = " << inc << " This element is expected to not be modified.";
}
}
}
}
/**
* Binary comparison of two vectors with length n and increment inc.
* Binary comparison of two vectors with length n and increment inc, printing variable names.
*/
template <typename T>
void computediff( gtint_t n, T *blis_x, T *blis_x_ref, T *blis_y, T *blis_y_ref, gtint_t incx, gtint_t incy, bool nan_inf_check = false )
@@ -365,8 +370,8 @@ void computediff( gtint_t n, T *blis_x, T *blis_x_ref, T *blis_y, T *blis_y_ref,
comp_helper.i = i;
idx = (incx > 0) ? (i * incx) : ( - ( n - i - 1 ) * incx );
idy = (incy > 0) ? (i * incy) : ( - ( n - i - 1 ) * incy );
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_x[idx], blis_y_ref[idy], comp_helper) << "incx = " << incx ;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_y[idy], blis_x_ref[idx], comp_helper) << "incy = " << incy; // Go through elements that are part of the array that should not have been modified by the
ASSERT_PRED_FORMAT4(NumericalComparison<T>, "x", blis_x[idx], blis_y_ref[idy], comp_helper) << "incx = " << incx ;
ASSERT_PRED_FORMAT4(NumericalComparison<T>, "y", blis_y[idy], blis_x_ref[idx], comp_helper) << "incy = " << incy; // Go through elements that are part of the array that should not have been modified by the
// call to a BLIS API. Use the bitwise comparison for this case.
// Random generator fills vector with T{-1.2345e38}
if (i < n-1)
@@ -374,22 +379,22 @@ void computediff( gtint_t n, T *blis_x, T *blis_x_ref, T *blis_y, T *blis_y_ref,
for (gtint_t j = 1; j < abs_incx; j++)
{
idx = (incx > 0) ? (i * incx) : ( - ( n - i - 1 ) * incx );
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_x[i*abs_incx + j], T{-1.2345e38}, comp_helper) << "incx = " << incx << " This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, "x", blis_x[i*abs_incx + j], T{-1.2345e38}, comp_helper) << "incx = " << incx << " This element is expected to not be modified.";
}
for (gtint_t j = 1; j < abs_incy; j++)
{
idy = (incy > 0) ? (i * incy) : ( - ( n - i - 1 ) * incy );
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_y[i*abs_incy + j], T{-1.2345e38}, comp_helper) << "incy = " << incy << " This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, "y", blis_y[i*abs_incy + j], T{-1.2345e38}, comp_helper) << "incy = " << incy << " This element is expected to not be modified.";
}
}
}
}
/**
* Relative comparison of two vectors with length n and increment inc.
* Relative comparison of two vectors with length n and increment inc, printing variable name.
*/
template <typename T>
void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, double thresh, bool nan_inf_check = false )
void computediff( std::string var_name, gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, double thresh, bool nan_inf_check = false )
{
gtint_t abs_inc = std::abs(inc);
ComparisonHelper comp_helper(VECTOR, thresh);
@@ -400,7 +405,7 @@ void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, double thresh
for (gtint_t i = 0; i < n; i++)
{
comp_helper.i = i;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*abs_inc], ref_sol[i*abs_inc], comp_helper) << "inc = " << inc;
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*abs_inc], ref_sol[i*abs_inc], comp_helper) << "inc = " << inc;
// Go through elements that are part of the array that should not have been modified by the
// call to a BLIS API. Use the bitwise comparison for this case.
if (i < n-1)
@@ -408,7 +413,7 @@ void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, double thresh
for (gtint_t j = 1; j < abs_inc; j++)
{
comp_helper.binary_comparison = true;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*abs_inc + j], ref_sol[i*abs_inc + j], comp_helper) << "inc = " << inc << " This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*abs_inc + j], ref_sol[i*abs_inc + j], comp_helper) << "inc = " << inc << " This element is expected to not be modified.";
}
comp_helper.binary_comparison = false;
}
@@ -416,10 +421,10 @@ void computediff( gtint_t n, T *blis_sol, T *ref_sol, gtint_t inc, double thresh
}
/**
* Binary comparison of two matrices with dimensions m-by-n and leading dimension ld.
* Binary comparison of two matrices with dimensions m-by-n and leading dimension ld, printing variable name.
*/
template <typename T>
void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gtint_t ld, bool nan_inf_check = false )
void computediff(std::string var_name, char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gtint_t ld, bool nan_inf_check = false )
{
gtint_t i,j;
ComparisonHelper comp_helper(MATRIX);
@@ -436,7 +441,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
{
comp_helper.i = i;
comp_helper.j = j;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper);
}
// Now iterate through the rest of elements in memory space that are not part of the matrix,
// so we use binary comparison to verify that are exactly the same as the reference.
@@ -444,7 +449,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
// elements are expected to identical.
for (i = m; i < ld; i++)
{
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper) << "This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper) << "This element is expected to not be modified.";
}
}
}
@@ -459,7 +464,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
{
comp_helper.i = i;
comp_helper.j = j;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper);
}
// Now iterate through the rest of elements in memory space that are not part of the matrix,
// so we use binary comparison to verify that are exactly the same as the reference.
@@ -467,17 +472,17 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
// elements are expected to identical.
for (j = n; j < ld; j++)
{
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper) << "This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper) << "This element is expected to not be modified.";
}
}
}
}
/**
* Relative comparison of two matrices with dimensions m-by-n and leading dimension ld.
* Relative comparison of two matrices with dimensions m-by-n and leading dimension ld, printing variable name.
*/
template <typename T>
void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gtint_t ld, double thresh, bool nan_inf_check = false )
void computediff(std::string var_name, char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gtint_t ld, double thresh, bool nan_inf_check = false )
{
gtint_t i,j;
ComparisonHelper comp_helper(MATRIX, thresh);
@@ -494,7 +499,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
{
comp_helper.i = i;
comp_helper.j = j;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper);
}
// Now iterate through the rest of elements in memory space that are not part of the matrix,
// so we use binary comparison to verify that are exactly the same as the reference.
@@ -503,7 +508,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
comp_helper.binary_comparison = true;
for (i = m; i < ld; i++)
{
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper) << "This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i + j*ld], ref_sol[i + j*ld], comp_helper) << "This element is expected to not be modified.";
}
// Disable binary comparison before we go through the next column.
comp_helper.binary_comparison = false;
@@ -520,7 +525,7 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
{
comp_helper.i = i;
comp_helper.j = j;
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper);
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper);
}
// Now iterate through the rest of elements in memory space that are not part of the matrix,
// so we use binary comparison to verify that are exactly the same as the reference.
@@ -529,10 +534,54 @@ void computediff(char storage, gtint_t m, gtint_t n, T *blis_sol, T *ref_sol, gt
comp_helper.binary_comparison = true;
for (j = n; j < ld; j++)
{
ASSERT_PRED_FORMAT3(NumericalComparison<T>, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper) << "This element is expected to not be modified.";
ASSERT_PRED_FORMAT4(NumericalComparison<T>, var_name, blis_sol[i*ld + j], ref_sol[i*ld + j], comp_helper) << "This element is expected to not be modified.";
}
// Disable binary comparison before we go through the next column.
comp_helper.binary_comparison = false;
}
}
}
// Generic comparison of integer numbers, printing variable name:
template<typename T>
testing::AssertionResult EqualityComparison(const char* var_name_char,
const char* blis_sol_char,
const char* ref_sol_char,
const char* comp_helper_char,
std::string var_name,
const T blis_sol,
const T ref_sol,
const ComparisonHelper comp_helper)
{
// Base error message used for scalar values
std::string error_message = var_name_char;
error_message += " = " + var_name + ", ";
error_message += blis_sol_char;
error_message += " = " + testinghelpers::to_string(blis_sol) + ", ";
error_message += ref_sol_char;
error_message += " = " + testinghelpers::to_string(ref_sol);
if (blis_sol == ref_sol) return testing::AssertionSuccess();
return testing::AssertionFailure() << error_message;
}
/**
* Comparison of two integers, printing variable name.
*/
template <>
inline void computediff<gtint_t>( std::string var_name, gtint_t blis_sol, gtint_t ref_sol, bool nan_inf_check )
{
ComparisonHelper comp_helper(SCALAR);
ASSERT_PRED_FORMAT4(EqualityComparison<gtint_t>, var_name, blis_sol, ref_sol, comp_helper);
}
/**
* Comparison of two characters, printing variable name.
*/
template <>
inline void computediff<char>( std::string var_name, char blis_sol, char ref_sol, bool nan_inf_check )
{
ComparisonHelper comp_helper(SCALAR);
ASSERT_PRED_FORMAT4(EqualityComparison<char>, var_name, blis_sol, ref_sol, comp_helper);
}

View File

@@ -66,5 +66,5 @@ void test_addv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, double thresh
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}

View File

@@ -81,7 +81,7 @@ TYPED_TEST(amaxv_IIT_ERS_Test, n_lt_one_nonUnitStride)
#endif
// Computing the difference.
EXPECT_EQ( idx, gtint_t(0) );
computediff<gtint_t>( "idx", idx, gtint_t(0) );
}
// inc == 0, with non-unit stride
@@ -101,7 +101,7 @@ TYPED_TEST(amaxv_IIT_ERS_Test, incx_eq_zero)
#endif
// Computing the difference.
EXPECT_EQ( idx, gtint_t(0) );
computediff<gtint_t>( "idx", idx, gtint_t(0) );
}
// n < 1, with unit stride
@@ -122,7 +122,7 @@ TYPED_TEST(amaxv_IIT_ERS_Test, n_lt_one_unitStride)
#endif
// Computing the difference.
EXPECT_EQ( idx, gtint_t(0) );
computediff<gtint_t>( "idx", idx, gtint_t(0) );
}
// n == 1, with unit stride
@@ -138,10 +138,10 @@ TYPED_TEST(amaxv_IIT_ERS_Test, n_eq_one_unitStride)
// Invoking AMAXV with an value of n.
#ifdef TEST_BLAS
gtint_t idx = amaxv_<T>( n, x.data(), unit_inc );
EXPECT_EQ( idx, gtint_t(1) );
computediff<gtint_t>( "idx", idx, gtint_t(1) );
#else
gtint_t idx = cblas_amaxv<T>( n, x.data(), unit_inc );
EXPECT_EQ( idx, gtint_t(0) );
computediff<gtint_t>( "idx", idx, gtint_t(0) );
#endif
}
@@ -156,10 +156,10 @@ TYPED_TEST(amaxv_IIT_ERS_Test, n_eq_one_nonUnitStrides)
#ifdef TEST_BLAS
gtint_t idx = amaxv_<T>( n, x.data(), inc );
EXPECT_EQ( idx, gtint_t(1) );
computediff<gtint_t>( "idx", idx, gtint_t(1) );
#else
gtint_t idx = cblas_amaxv<T>( n, x.data(), inc );
EXPECT_EQ( idx, gtint_t(0) );
computediff<gtint_t>( "idx", idx, gtint_t(0) );
#endif
}

View File

@@ -63,7 +63,7 @@ static void test_amaxv( gtint_t n, gtint_t incx )
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
EXPECT_EQ(idx, idx_ref) << "Values are different : act_val : " << idx << " ref_val :" << idx_ref;
computediff<gtint_t>( "idx", idx, idx_ref );
}
/**
@@ -99,5 +99,5 @@ static void test_amaxv( gtint_t n, gtint_t incx, gtint_t xi, T xi_exval,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
EXPECT_EQ(idx, idx_ref) << "Values are different : act_val : " << idx << " ref_val :" << idx_ref;
computediff<gtint_t>( "idx", idx, idx_ref );
}

View File

@@ -74,7 +74,7 @@ TYPED_TEST(Axpbyv_IIT_ERS_Test, n_lt_zero_nonUnitStrides)
axpbyv<T>( CONJ, -1, alpha, x.data(), 5, beta, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// When n = 0
@@ -94,7 +94,7 @@ TYPED_TEST(Axpbyv_IIT_ERS_Test, n_eq_zero_nonUnitStrides)
axpbyv<T>( CONJ, 0, alpha, x.data(), 5, beta, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// Early return cases with unit strides on vectors
@@ -115,7 +115,7 @@ TYPED_TEST(Axpbyv_IIT_ERS_Test, n_lt_zero_unitStrides)
axpbyv<T>( CONJ, -1, alpha, x.data(), 1, beta, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
// When n = 0
@@ -135,6 +135,6 @@ TYPED_TEST(Axpbyv_IIT_ERS_Test, n_eq_zero_unitStrides)
axpbyv<T>( CONJ, 0, alpha, x.data(), 1, beta, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
#endif
#endif

View File

@@ -67,7 +67,7 @@ static void test_axpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}
template<typename T>
@@ -104,5 +104,5 @@ static void test_axpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh, true );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
}

View File

@@ -89,5 +89,5 @@ static void test_axpyf(
//---------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( m, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", m, y.data(), y_ref.data(), incy, thresh, true );
}

View File

@@ -72,7 +72,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, n_lt_zero_nonUnitStrides)
axpyv<T>( CONJ, -1, alpha, x.data(), 5, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// When n = 0
@@ -91,7 +91,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, n_eq_zero_nonUnitStrides)
axpyv<T>( CONJ, 0, alpha, x.data(), 5, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// When alpha = 0
@@ -110,7 +110,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, alpha_eq_zero_nonUnitStrides)
axpyv<T>( CONJ, N, alpha, x.data(), 5, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// Early return cases with unit strides on vectors
@@ -130,7 +130,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, n_lt_zero_unitStrides)
axpyv<T>( CONJ, -1, alpha, x.data(), 1, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
// When n = 0
@@ -149,7 +149,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, n_eq_zero_unitStrides)
axpyv<T>( CONJ, 0, alpha, x.data(), 1, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
// When alpha = 0
@@ -168,7 +168,7 @@ TYPED_TEST(Axpyv_IIT_ERS_Test, alpha_eq_zero_unitStrides)
axpyv<T>( CONJ, N, alpha, x.data(), 1, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
#endif

View File

@@ -67,7 +67,7 @@ static void test_axpyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}
template<typename T>
@@ -104,5 +104,5 @@ static void test_axpyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh, true );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
}

View File

@@ -69,7 +69,7 @@ TYPED_TEST(Copyv_IIT_ERS_Test, n_lt_zero_nonUnitStrides)
copyv<T>( CONJ, -1, x.data(), 5, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// When n = 0
@@ -86,7 +86,7 @@ TYPED_TEST(Copyv_IIT_ERS_Test, n_eq_zero_nonUnitStrides)
copyv<T>( CONJ, 0, x.data(), 5, y.data(), 5 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 5 );
computediff( "y", N, y.data(), y_ref.data(), 5 );
}
// Early return cases with unit strides on vectors
@@ -104,7 +104,7 @@ TYPED_TEST(Copyv_IIT_ERS_Test, n_lt_zero_unitStrides)
copyv<T>( CONJ, -1, x.data(), 1, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
// When n = 0
@@ -121,6 +121,6 @@ TYPED_TEST(Copyv_IIT_ERS_Test, n_eq_zero_unitStrides)
copyv<T>( CONJ, 0, x.data(), 1, y.data(), 1 );
// Use bitwise comparison (no threshold).
computediff( N, y.data(), y_ref.data(), 1 );
computediff( "y", N, y.data(), y_ref.data(), 1 );
}
#endif
#endif

View File

@@ -67,5 +67,5 @@ static void test_copyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy )
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy );
computediff<T>( "y", n, y.data(), y_ref.data(), incy );
}

View File

@@ -76,7 +76,7 @@ TYPED_TEST(dotv_IIT_ERS_Test, n_lt_zero_nonUnitStride)
dotv<T>( CONJ, CONJ, invalid_n, x.data(), inc, y.data(), inc, &rho );
// Computing the difference.
computediff<T>( rho, rho_ref );
computediff<T>( "rho", rho, rho_ref );
}
// n == 0, with non-unit stride
@@ -101,7 +101,7 @@ TYPED_TEST(dotv_IIT_ERS_Test, n_eq_zero_nonUnitStride)
dotv<T>( CONJ, CONJ, invalid_n, x.data(), inc, y.data(), inc, &rho );
// Computing the difference.
computediff<T>( rho, rho_ref );
computediff<T>( "rho", rho, rho_ref );
}
// n < 0, with unit stride
@@ -126,7 +126,7 @@ TYPED_TEST(dotv_IIT_ERS_Test, n_lt_zero_unitStride)
dotv<T>( CONJ, CONJ, invalid_n, x.data(), unit_inc, y.data(), unit_inc, &rho );
// Computing the difference.
computediff<T>( rho, rho_ref );
computediff<T>( "rho", rho, rho_ref );
}
// n == 0, with unit stride
@@ -151,6 +151,6 @@ TYPED_TEST(dotv_IIT_ERS_Test, n_eq_zero_unitStride)
dotv<T>( CONJ, CONJ, invalid_n, x.data(), unit_inc, y.data(), unit_inc, &rho );
// Computing the difference.
computediff<T>( rho, rho_ref );
computediff<T>( "rho", rho, rho_ref );
}
#endif
#endif

View File

@@ -72,7 +72,7 @@ static void test_dotv( char conjx, char conjy, gtint_t n, gtint_t incx,
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<T>( rho, rho_ref, thresh );
computediff<T>( "rho", rho, rho_ref, thresh );
}
@@ -119,5 +119,5 @@ static void test_dotv( char conjx, char conjy, gtint_t n,
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<T>( rho, rho_ref, thresh, true);
computediff<T>( "rho", rho, rho_ref, thresh, true);
}

View File

@@ -85,5 +85,5 @@ static void test_dotxf(
//---------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( m, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", m, y.data(), y_ref.data(), incy, thresh, true );
}

View File

@@ -71,5 +71,5 @@ static void test_dotxv( gtint_t n, char conjx, char conjy, T alpha,
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<T>( rho, rho_ref, thresh );
computediff<T>( "rho", rho, rho_ref, thresh );
}

View File

@@ -66,5 +66,5 @@ static void test_scal2v(char conjx, gtint_t n, gtint_t incx, gtint_t incy, T alp
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}

View File

@@ -84,7 +84,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, n_lt_zero_nonUnitStride)
scalv<T, RT>( 'n', invalid_n, alpha, x.data(), inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), inc );
computediff<T>( "x", N, x.data(), x_ref.data(), inc );
}
// n == 0, with non-unit stride
@@ -107,7 +107,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, n_eq_zero_nonUnitStride)
scalv<T, RT>( 'n', invalid_n, alpha, x.data(), inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), inc );
computediff<T>( "x", N, x.data(), x_ref.data(), inc );
}
// n < 0, with unit stride
@@ -130,7 +130,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, n_lt_zero_unitStride)
scalv<T, RT>( 'n', invalid_n, alpha, x.data(), unit_inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), unit_inc );
computediff<T>( "x", N, x.data(), x_ref.data(), unit_inc );
}
// n == 0, with unit stride
@@ -153,7 +153,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, n_eq_zero_unitStride)
scalv<T, RT>( 'n', invalid_n, alpha, x.data(), unit_inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), unit_inc );
computediff<T>( "x", N, x.data(), x_ref.data(), unit_inc );
}
// inc < 0
@@ -175,7 +175,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, inc_lt_0)
scalv<T, RT>( 'n', N, alpha, x.data(), invalid_inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
// inc == 0
@@ -197,7 +197,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, inc_eq_0)
scalv<T, RT>( 'n', N, alpha, x.data(), invalid_inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
// alpha == 1, with non-unit stride
@@ -218,7 +218,7 @@ TYPED_TEST(scalv_IIT_ERS_Test, alpha_eq_one_nonUnitStride)
scalv<T, RT>( 'n', N, invalid_alpha, x.data(), inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), inc );
computediff<T>( "x", N, x.data(), x_ref.data(), inc );
}
// alpha == 1, with unit stride
@@ -239,6 +239,6 @@ TYPED_TEST(scalv_IIT_ERS_Test, alpha_eq_one_unitStride)
scalv<T, RT>( 'n', N, invalid_alpha, x.data(), unit_inc );
// Computing bitwise difference.
computediff<T>( N, x.data(), x_ref.data(), unit_inc );
computediff<T>( "x", N, x.data(), x_ref.data(), unit_inc );
}
#endif

View File

@@ -74,7 +74,7 @@ TYPED_TEST(xscalv, zero_alpha_x_fp)
//----------------------------------------------------------
// Call generic test body using those parameters
//----------------------------------------------------------
computediff<T>( n, x.data(), x_ref.data(), incx, thresh, true );
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh, true );
}
TYPED_TEST(xscalv, zero_alpha_x_inf)
@@ -113,5 +113,5 @@ TYPED_TEST(xscalv, zero_alpha_x_inf)
//----------------------------------------------------------
// Call generic test body using those parameters
//----------------------------------------------------------
computediff<T>( n, x.data(), x_ref.data(), incx, thresh, true );
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh, true );
}

View File

@@ -64,7 +64,7 @@ static void test_scalv( char conja_alpha, gtint_t n, gtint_t incx, U alpha, doub
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, x.data(), x_ref.data(), incx, thresh );
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh );
}
/**
@@ -98,5 +98,5 @@ static void test_scalv( char conja_alpha, gtint_t n, gtint_t incx, gtint_t xi,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, x.data(), x_ref.data(), incx, thresh, true );
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh, true );
}

View File

@@ -72,7 +72,7 @@ TYPED_TEST(subv_IIT_ERS_Test, n_lt_zero_nonUnitStride)
subv<T>( 'n', invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", n, y.data(), y_ref.data(), inc );
}
// n < 0, with unit stride
@@ -93,7 +93,7 @@ TYPED_TEST(subv_IIT_ERS_Test, n_lt_zero_unitStride)
subv<T>( 'n', invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", n, y.data(), y_ref.data(), inc );
}
// n == 0, with non-unit stride
@@ -114,7 +114,7 @@ TYPED_TEST(subv_IIT_ERS_Test, n_eq_zero_nonUnitStride)
subv<T>( 'n', invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", n, y.data(), y_ref.data(), inc );
}
// n == 0, with unit stride
@@ -135,6 +135,6 @@ TYPED_TEST(subv_IIT_ERS_Test, n_eq_zero_unitStride)
subv<T>( 'n', invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", n, y.data(), y_ref.data(), inc );
}
#endif

View File

@@ -66,7 +66,7 @@ void test_subv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, double thresh
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}
template<typename T>
@@ -98,5 +98,5 @@ static void test_subv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh, true );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
}

View File

@@ -72,7 +72,7 @@ TYPED_TEST(swapv_IIT_ERS_Test, n_lt_zero_nonUnitStride)
swapv<T>( invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", N, y.data(), y_ref.data(), inc );
}
// n < 0, with unit stride
@@ -93,7 +93,7 @@ TYPED_TEST(swapv_IIT_ERS_Test, n_lt_zero_unitStride)
swapv<T>( invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", N, y.data(), y_ref.data(), inc );
}
// n == 0, with non-unit stride
@@ -114,7 +114,7 @@ TYPED_TEST(swapv_IIT_ERS_Test, n_eq_zero_nonUnitStride)
swapv<T>( invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", N, y.data(), y_ref.data(), inc );
}
// n == 0, with unit stride
@@ -135,7 +135,7 @@ TYPED_TEST(swapv_IIT_ERS_Test, n_eq_zero_unitStride)
swapv<T>( invalid_n, x.data(), inc, y.data(), inc );
// Use bitwise comparison (no threshold).
computediff<T>( N, y.data(), y_ref.data(), inc );
computediff<T>( "y", N, y.data(), y_ref.data(), inc );
}
#endif

View File

@@ -67,5 +67,5 @@ static void test_xpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}

View File

@@ -87,7 +87,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, n_eq_zero_Unitalphabeta)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), y_ref.data(), incy);
computediff<T>( "y", N, y.data(), y_ref.data(), incy);
}
TYPED_TEST(gemv_IIT_ERS_Test, ZeroBeta_Unitalpha)
@@ -121,7 +121,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, ZeroBeta_Unitalpha)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), y_ref.data(), incy);
computediff<T>( "y", N, y.data(), y_ref.data(), incy);
}
TYPED_TEST(gemv_IIT_ERS_Test, m_eq_zero_Unitbeta)
@@ -157,7 +157,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, m_eq_zero_Unitbeta)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), y_ref.data(), incy);
computediff<T>( "y", N, y.data(), y_ref.data(), incy);
}
TYPED_TEST(gemv_IIT_ERS_Test, m_lt_zero_Unitscalar)
@@ -193,7 +193,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, m_lt_zero_Unitscalar)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), y_ref.data(), incy);
computediff<T>( "y", N, y.data(), y_ref.data(), incy);
}
TYPED_TEST(gemv_IIT_ERS_Test, n_lt_zero_Unitscalar)
@@ -229,7 +229,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, n_lt_zero_Unitscalar)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), y_ref.data(), incy);
computediff<T>( "y", N, y.data(), y_ref.data(), incy);
}
TYPED_TEST(gemv_IIT_ERS_Test, Zero_scalar)
@@ -266,6 +266,7 @@ TYPED_TEST(gemv_IIT_ERS_Test, Zero_scalar)
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( N, y.data(), zero_vec.data(), incy);
computediff<T>( "y", N, y.data(), zero_vec.data(), incy);
}
#endif

View File

@@ -135,5 +135,5 @@ void test_gemv( char storage, char transa, char conjx, gtint_t m, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( leny, y, y_ref, incy, thresh, is_evt_test );
computediff<T>( "y", leny, y, y_ref, incy, thresh );
}

View File

@@ -78,7 +78,7 @@ TYPED_TEST(ger_IIT_ERS_Test, m_eq_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// m == 0, with non-unit stride
@@ -103,7 +103,7 @@ TYPED_TEST(ger_IIT_ERS_Test, m_eq_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// n == 0, with unit stride
@@ -128,7 +128,7 @@ TYPED_TEST(ger_IIT_ERS_Test, n_eq_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// n == 0, with non-unit stride
@@ -153,7 +153,7 @@ TYPED_TEST(ger_IIT_ERS_Test, n_eq_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// alpha == 0, with unit stride
@@ -176,7 +176,7 @@ TYPED_TEST(ger_IIT_ERS_Test, alpha_eq_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// alpha == 0, with non-unit stride
@@ -199,7 +199,7 @@ TYPED_TEST(ger_IIT_ERS_Test, alpha_eq_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
@@ -235,7 +235,7 @@ TYPED_TEST(ger_IIT_ERS_Test, m_lt_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// m < 0, with non-unit stride
@@ -260,7 +260,7 @@ TYPED_TEST(ger_IIT_ERS_Test, m_lt_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// n < 0, with unit stride
@@ -285,7 +285,7 @@ TYPED_TEST(ger_IIT_ERS_Test, n_lt_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// n < 0, with non-unit stride
@@ -310,7 +310,7 @@ TYPED_TEST(ger_IIT_ERS_Test, n_lt_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// incx = 0, with unit incy
@@ -335,7 +335,7 @@ TYPED_TEST(ger_IIT_ERS_Test, incx_eq_zero_unitStride)
y.data(), unit_inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// incx = 0, with non-unit incy
@@ -360,7 +360,7 @@ TYPED_TEST(ger_IIT_ERS_Test, incx_eq_zero_nonUnitStride)
y.data(), inc, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// incy = 0, with unit incy
@@ -385,7 +385,7 @@ TYPED_TEST(ger_IIT_ERS_Test, incy_eq_zero_unitStride)
y.data(), invalid_incy, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// incy = 0, with non-unit incy
@@ -410,7 +410,7 @@ TYPED_TEST(ger_IIT_ERS_Test, incy_eq_zero_nonUnitStride)
y.data(), invalid_incy, a.data(), LDA );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// lda < max(1, M), with unit stride
@@ -435,7 +435,7 @@ TYPED_TEST(ger_IIT_ERS_Test, lda_lt_max_1_m_unitStride)
y.data(), unit_inc, a.data(), invalid_lda );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
// lda < max(1, M), with non-unit stride
@@ -460,6 +460,6 @@ TYPED_TEST(ger_IIT_ERS_Test, lda_lt_max_1_m_nonUnitStride)
y.data(), inc, a.data(), invalid_lda );
// Computing bitwise difference.
computediff<T>( STORAGE, M, N, a.data(), a_ref.data(), LDA );
computediff<T>( "A", STORAGE, M, N, a.data(), a_ref.data(), LDA );
}
#endif

View File

@@ -71,7 +71,7 @@ void test_ger( char storage, char conjx, char conjy, gtint_t m, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, a.data(), a_ref.data(), lda, thresh );
computediff<T>( "a", storage, m, n, a.data(), a_ref.data(), lda, thresh );
}
template<typename T>
@@ -116,5 +116,5 @@ void test_ger( char storage, char conjx, char conjy, gtint_t m, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, a.data(), a_ref.data(), lda, thresh, true );
computediff<T>( "A", storage, m, n, a.data(), a_ref.data(), lda, thresh, true );
}

View File

@@ -74,5 +74,5 @@ void test_hemv( char storage, char uploa, char conja, char conjx, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}

View File

@@ -71,5 +71,5 @@ void test_her( char storage, char uploa, char conjx, gtint_t n, Tr alpha,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, a.data(), a_ref.data(), lda, thresh );
computediff<T>( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh );
}

View File

@@ -74,5 +74,5 @@ void test_her2( char storage, char uploa, char conjx, char conjy, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, a.data(), a_ref.data(), lda, thresh );
computediff<T>( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh );
}

View File

@@ -74,5 +74,5 @@ void test_symv( char storage, char uploa, char conja, char conjx, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( n, y.data(), y_ref.data(), incy, thresh );
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
}

View File

@@ -71,5 +71,5 @@ void test_syr( char storage, char uploa, char conjx, gtint_t n, T alpha,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, a.data(), a_ref.data(), lda, thresh );
computediff<T>( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh );
}

View File

@@ -74,5 +74,5 @@ void test_syr2( char storage, char uploa, char conjx, char conjy, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, a.data(), a_ref.data(), lda, thresh );
computediff<T>( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh );
}

View File

@@ -70,5 +70,5 @@ void test_trmv( char storage, char uploa, char transa, char diaga, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( n, x.data(), x_ref.data(), incx, thresh );
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh );
}

View File

@@ -77,7 +77,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_UPLO)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, 'A', TRANS, DIAG, N, &alpha, nullptr, LDA, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
/**
@@ -94,7 +94,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_TRANS)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, 'A', DIAG, N, &alpha, nullptr, LDA, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
/**
@@ -110,7 +110,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_DIAG)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, TRANS, 'A', N, &alpha, nullptr, LDA, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
/**
@@ -126,7 +126,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_n)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, TRANS, DIAG, -1, &alpha, nullptr, LDA, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
@@ -143,7 +143,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_lda)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, TRANS, DIAG, N, &alpha, nullptr, LDA - 1, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
/**
@@ -159,7 +159,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, invalid_incx)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, TRANS, DIAG, N, &alpha, nullptr, LDA, x.data(), 0);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
@@ -184,7 +184,7 @@ TYPED_TEST(TRSV_IIT_ERS_Test, n_eq_zero)
std::vector<T> x_ref(x);
trsv<T>( STORAGE, UPLO, TRANS, DIAG, 0, &alpha, nullptr, LDA, x.data(), INC);
computediff<T>( N, x.data(), x_ref.data(), INC );
computediff<T>( "x", N, x.data(), x_ref.data(), INC );
}
#endif
#endif

View File

@@ -144,5 +144,5 @@ void test_trsv(
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( n, x_ptr, x_ref.data(), incx, thresh, is_evt_test );
computediff<T>( "x", n, x_ptr, x_ref.data(), incx, thresh, is_evt_test );
}

View File

@@ -81,7 +81,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, invalid_transa)
// Call BLIS Gemm with a invalid value for TRANS value for A.
gemm<T>( STORAGE, 'p', TRANS, M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 2
@@ -102,7 +102,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, invalid_transb)
// Call BLIS Gemm with a invalid value for TRANS value for B.
gemm<T>( STORAGE, TRANS, 'p', M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 3
@@ -122,7 +122,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, m_lt_zero)
// Call BLIS Gemm with a invalid value for m.
gemm<T>( STORAGE, TRANS, TRANS, -1, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 4
@@ -142,7 +142,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, n_lt_zero)
// Call BLIS Gemm with a invalid value for n.
gemm<T>( STORAGE, TRANS, TRANS, M, -1, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 5
@@ -162,7 +162,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, k_lt_zero)
// Call BLIS Gemm with a invalid value for k.
gemm<T>( STORAGE, TRANS, TRANS, M, N, -1, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 8
@@ -182,7 +182,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, invalid_lda)
// Call BLIS Gemm with a invalid value for lda.
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, a.data(), LDA - 1, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 10
@@ -202,7 +202,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, invalid_ldb)
// Call BLIS Gemm with a invalid value for ldb.
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, a.data(), LDA, b.data(), LDB - 1, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 13
@@ -222,7 +222,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, invalid_ldc)
// Call BLIS Gemm with a invalid value for ldc.
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
/*
@@ -252,7 +252,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, m_eq_zero)
testinghelpers::initone<T>( beta );
gemm<T>( STORAGE, TRANS, TRANS, 0, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When n is 0
@@ -271,7 +271,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, n_eq_zero)
testinghelpers::initone<T>( beta );
gemm<T>( STORAGE, TRANS, TRANS, M, 0, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When alpha is 0 and beta is 1
@@ -292,7 +292,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, alpha_zero_beta_one)
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When k is 0 and beta is 1
@@ -313,7 +313,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, k_zero_beta_one)
gemm<T>( STORAGE, TRANS, TRANS, M, N, 0, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
#if 0
@@ -338,7 +338,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, null_a_matrix)
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, nullptr, LDA, b.data(), LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When b matrix is null
@@ -357,7 +357,7 @@ TYPED_TEST(Gemm_IIT_ERS_Test, null_b_matrix)
gemm<T>( STORAGE, TRANS, TRANS, M, N, K, &alpha, a.data(), LDA, nullptr, LDB, &beta, c.data(), LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
#endif /* #IF 0 ENDS HERE */
#endif

View File

@@ -76,7 +76,7 @@ void test_gemm( char storage, char trnsa, char trnsb, gtint_t m, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "c", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}
// Test body used for exception value testing, by inducing an exception value
@@ -135,7 +135,7 @@ void test_gemm( char storage, char trnsa, char trnsb, gtint_t m, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh, true );
computediff<T>( "c", storage, m, n, c.data(), c_ref.data(), ldc, thresh, true );
}
// Test body used for overflow and underflow checks
@@ -242,5 +242,5 @@ void test_gemm( char storage, char trnsa, char trnsb, gtint_t over_under, gtint_
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh, true );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh, true );
}

View File

@@ -73,7 +73,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_transa)
// Call BLIS Gemm with a invalid value for TRANS value for A.
gemm_compute<T>( STORAGE, 'x', TRANS, 'U', 'U', M, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 2
@@ -88,7 +88,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_transb)
// Call BLIS Gemm with a invalid value for TRANS value for A.
gemm_compute<T>( STORAGE, TRANS, 'x', 'U', 'U', M, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 3
@@ -103,7 +103,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, m_lt_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', -1, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 4
@@ -118,7 +118,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, n_lt_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, -1, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 5
@@ -133,7 +133,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, k_lt_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, N, -1, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 7
@@ -148,7 +148,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_lda)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, nullptr, nullptr, LDA - 1, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 9
@@ -163,7 +163,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_ldb)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, nullptr, nullptr, LDA, nullptr, LDB - 1, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 12
@@ -178,7 +178,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_ldc_lt_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, -1 );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When info == 12
@@ -193,7 +193,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, invalid_ldc)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC - 1 );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
/*
@@ -217,7 +217,7 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, m_eq_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', 0, N, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
// When n = 0
@@ -232,6 +232,6 @@ TYPED_TEST(GEMM_Compute_IIT_ERS_Test, n_eq_zero)
// Call BLIS Gemm with a invalid value for m.
gemm_compute<T>( STORAGE, TRANS, TRANS, 'U', 'U', M, 0, K, nullptr, nullptr, LDA, nullptr, LDB, nullptr, nullptr, LDC );
// Use bitwise comparison (no threshold).
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC);
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC);
}
#endif

View File

@@ -75,5 +75,5 @@ void test_gemm_compute( char storage, char trnsa, char trnsb, char pcka, char pc
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -80,7 +80,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_uploa)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, 'A', TRANS, TRANS, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 2
@@ -100,7 +100,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_transa)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, 'A', TRANS, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 3
@@ -120,7 +120,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_transb)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, 'A', N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 4
@@ -140,7 +140,7 @@ TYPED_TEST(GEMMT_IIT_ERS, n_lt_zero)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, -1, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 5
@@ -160,7 +160,7 @@ TYPED_TEST(GEMMT_IIT_ERS, k_lt_zero)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, -1, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 8
@@ -180,7 +180,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_lda)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, K, &alpha, a.data(), LDA-1, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 10
@@ -200,7 +200,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_ldb)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, K, &alpha, a.data(), LDA, b.data(), LDB-1, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When info == 13
@@ -220,7 +220,7 @@ TYPED_TEST(GEMMT_IIT_ERS, invalid_ldc)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC-1 );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
/*
@@ -250,7 +250,7 @@ TYPED_TEST(GEMMT_IIT_ERS, n_eq_zero)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, 0, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When alpha is 0 and beta is 1
@@ -270,7 +270,7 @@ TYPED_TEST(GEMMT_IIT_ERS, alpha_zero_beta_one)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
// When k is 0 and beta is 1
@@ -290,7 +290,7 @@ TYPED_TEST(GEMMT_IIT_ERS, k_zero_beta_one)
testinghelpers::initone<T>( beta );
gemmt<T>( STORAGE, UPLO, TRANS, TRANS, N, 0, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC );
computediff<T>( STORAGE, N, N, c.data(), c_ref.data(), LDC );
computediff<T>( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC );
}
#endif

View File

@@ -136,5 +136,5 @@ void test_gemmt( char storage, char uplo, char trnsa, char trnsb, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, c_ptr, c_ref.data(), ldc, thresh, is_evt_test );
computediff<T>( "C", storage, n, n, c_ptr, c_ref.data(), ldc, thresh, is_evt_test );
}

View File

@@ -79,5 +79,5 @@ void test_hemm( char storage, char side, char uplo, char conja, char transb,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -78,5 +78,5 @@ void test_her2k( char storage, char uplo, char transa, char transb,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -60,6 +60,7 @@ void test_herk( char storage, char uplo, char transa, gtint_t n, gtint_t k,
// Create a copy of c so that we can check reference results.
std::vector<T> c_ref(c);
//----------------------------------------------------------
// Call BLIS function
//----------------------------------------------------------
@@ -75,5 +76,5 @@ void test_herk( char storage, char uplo, char transa, gtint_t n, gtint_t k,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -80,5 +80,5 @@ void test_symm( char storage, char side, char uplo, char conja, char transb,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -78,5 +78,5 @@ void test_syr2k( char storage, char uplo, char transa, char transb, gtint_t n,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -59,18 +59,21 @@ void test_syrk( char storage, char uplo, char transa, gtint_t n, gtint_t k,
// Create a copy of c so that we can check reference results.
std::vector<T> c_ref(c);
//----------------------------------------------------------
// Call BLIS function
//----------------------------------------------------------
syrk<T>( storage, uplo, transa, n, k, &alpha, a.data(), lda,
&beta, c.data(), ldc );
//----------------------------------------------------------
// Call reference implementation.
//----------------------------------------------------------
testinghelpers::ref_syrk<T>( storage, uplo, transa, n, k, alpha,
a.data(), lda, beta, c_ref.data(), ldc );
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, n, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh );
}

View File

@@ -72,5 +72,5 @@ void test_trmm( char storage, char side, char uploa, char transa, char diaga,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, b.data(), b_ref.data(), ldb, thresh );
computediff<T>( "B", storage, m, n, b.data(), b_ref.data(), ldb, thresh );
}

View File

@@ -76,5 +76,5 @@ void test_trmm3( char storage, char side, char uploa, char transa, char diaga,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldb, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldb, thresh );
}

View File

@@ -63,7 +63,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_side)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, 'a', UPLO, TRANS, DIAG, M, N, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -79,7 +79,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_UPLO)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, 'a', TRANS, DIAG, M, N, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -95,7 +95,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_TRANS)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, 'a', DIAG, M, N, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -110,7 +110,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_DIAG)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, 'a', M, N, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -125,7 +125,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_m)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, -2, N, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -140,7 +140,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_n)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, M, -2, nullptr, nullptr, LDA, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -155,7 +155,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_lda)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, M, N, nullptr, nullptr, LDA - 1, b.data(), LDB);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -170,7 +170,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, invalid_ldb)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, M, N, nullptr, nullptr, LDA, b.data(), LDB - 1);
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
@@ -195,7 +195,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, m_eq_zero)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, 0, N, nullptr, nullptr, LDA, b.data(), LDB );
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
/**
@@ -209,7 +209,7 @@ TYPED_TEST(TRSM_IIT_ERS_Test, n_eq_zero)
std::vector<T> b_ref(b);
trsm<T>( STORAGE, SIDE, UPLO, TRANS, DIAG, M, 0, nullptr, nullptr, LDA, b.data(), LDB );
computediff<T>( STORAGE, M, N, b.data(), b_ref.data(), LDB );
computediff<T>( "B", STORAGE, M, N, b.data(), b_ref.data(), LDB );
}
#endif
#endif

View File

@@ -243,5 +243,5 @@ void test_trsm( char storage, char side, char uploa, char transa, char diaga,
//----------------------------------------------------------
// check component-wise error.
//----------------------------------------------------------
computediff<T>( storage, m, n, b.data(), b_ref.data(), ldb, thresh, nan_inf_check );
computediff<T>( "B", storage, m, n, b.data(), b_ref.data(), ldb, thresh, nan_inf_check );
}

View File

@@ -111,5 +111,5 @@ void test_amaxv_ukr( FT ukr_fp, gtint_t n, gtint_t incx, double thresh, bool is_
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
EXPECT_EQ( idx, idx_ref );
computediff<gtint_t>( "idx", idx, idx_ref );
}

View File

@@ -122,5 +122,5 @@ static void test_axpbyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gti
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y, y_ref, incy, thresh );
computediff<T>( "y", n, y, y_ref, incy, thresh );
}

View File

@@ -122,6 +122,6 @@ static void test_axpyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gtin
//----------------------------------------------------------
// Compute component-wise error.
//----------------------------------------------------------
computediff<T>( n, y, y_ref, incy, thresh );
computediff<T>( "y", n, y, y_ref, incy, thresh );
}

View File

@@ -121,5 +121,5 @@ static void test_copyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gtin
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<T>( n, y, y_ref, incy );
computediff<T>( "y", n, y, y_ref, incy );
}

View File

@@ -122,5 +122,5 @@ static void test_dotv_ukr( FT ukr, char conjx, char conjy, gtint_t n, gtint_t in
testinghelpers::ref_dotv<T>( conjx, conjy, n, x, incx, y_ref, incy, &rho_ref );
// Compute component-wise error.
computediff<T>( rho, rho_ref, thresh );
computediff<T>( "rho", rho, rho_ref, thresh );
}

View File

@@ -592,7 +592,7 @@ TEST_P(dgemmSmallUkernel, gemm_small)
testinghelpers::ref_gemm<T>( storage, 'n', 'n', m, n, k, alpha,
a, lda, b, ldb, beta, cref, ldc);
// Check component-wise error
computediff<T>( storage, m, n, c, cref, ldc, thresh );
computediff<T>( "C", storage, m, n, c, cref, ldc, thresh );
free(cref);
}
@@ -641,7 +641,7 @@ TEST_P(dgemmSmallUkernel, gemm_small)
testinghelpers::ref_gemm<T>( storage, 'n', 'n', m, n, k, alpha,
a.data(), lda, b.data(), ldb, beta, c_ref.data(), ldc);
// Check component-wise error
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}
}// end of function

View File

@@ -484,7 +484,7 @@ TEST_P(SGemmSmallUkernelTest, gemm_small)
a.data(), lda, b.data(), ldb, beta, c_ref.data(), ldc);
// Check component-wise error
computediff<T>( storage, m, n, c.data(), c_ref.data(), ldc, thresh );
computediff<T>( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh );
}// end of function

View File

@@ -231,7 +231,7 @@ static void test_complex_gemmsup_ukr( char storage, char trnsa, char trnsb, gtin
buf_a, lda, buf_b, ldb, beta, buf_cref, ldc);
// Check component-wise error
computediff<T>( storage, m, n, buf_c, buf_cref, ldc, thresh );
computediff<T>( "C", storage, m, n, buf_c, buf_cref, ldc, thresh );
}
@@ -408,6 +408,6 @@ static void test_gemmnat_ukr( char storage, gtint_t m, gtint_t n, gtint_t k, T a
buf_a, lda, buf_b, ldb, beta, (T*)buf_cref, ldc);
// Check component-wise error
computediff<T>( storage, m, n, (T*)buf_c, (T*)buf_cref, ldc, thresh );
computediff<T>( "C", storage, m, n, (T*)buf_c, (T*)buf_cref, ldc, thresh );
}

View File

@@ -226,7 +226,7 @@ static void test_gemmnat_ukr(
buf_a, lda, buf_b, ldb, beta, (T*)buf_cref, ldc);
// Check component-wise error
computediff<T>( storage, m, n, (T*)buf_c, (T*)buf_cref, ldc, thresh );
computediff<T>( "C", storage, m, n, (T*)buf_c, (T*)buf_cref, ldc, thresh );
}
@@ -354,7 +354,7 @@ static void test_gemmk1_ukr( FT ukr_fp, gtint_t m, gtint_t n, gtint_t k, char st
buf_a, lda, buf_b, ldb, beta, buf_cref, ldc);
// Check component-wise error
computediff<T>( storage, m, n, buf_c, buf_cref, ldc, thresh );
computediff<T>( "C", storage, m, n, buf_c, buf_cref, ldc, thresh );
}
template<typename T, typename FT>
@@ -591,5 +591,5 @@ static void test_gemmsup_ukr( FT ukr_fp, char trnsa, char trnsb, gtint_t m, gtin
buf_a, lda, buf_b, ldb, beta, ref_c, ldc);
// Check component-wise error
computediff<T>( storage, m, n, buf_c, ref_c, ldc, thresh );
computediff<T>( "C", storage, m, n, buf_c, ref_c, ldc, thresh );
}

View File

@@ -115,6 +115,6 @@ static void test_nrm2_ukr( nrm2_ker_ft<T, RT> ukr_fp, gtint_t n, gtint_t incx, d
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<RT>( norm, norm_ref, thresh );
computediff<RT>( "norm", norm, norm_ref, thresh );
}

View File

@@ -113,5 +113,5 @@ static void test_scalv_ukr( FT ukr, char conja_alpha, gtint_t n, gtint_t incx,
testinghelpers::ref_scalv<T, U>( conja_alpha, n, alpha, x_ref, incx );
// Compute component-wise error.
computediff<T>( n, x, x_ref, incx, thresh );
computediff<T>( "x", n, x, x_ref, incx, thresh );
}

View File

@@ -299,7 +299,7 @@ static void test_trsm_ukr( FT ukr_fp, char storage, char uploa, char diaga,
}
// Compute component-wise error.
computediff<T>( storage, m, n, c, c_ref, ldc, thresh );
computediff<T>( "C", storage, m, n, c, c_ref, ldc, thresh );
if(storage != 'r' && storage != 'R' && storage != 'c' && storage != 'C')
{
@@ -419,8 +419,8 @@ static void test_trsm_small_ukr( FT ukr_fp, char side, char uploa, char diaga,
testinghelpers::ref_trsm<T>( 'c', side, uploa, transa, diaga, m, n, alpha, a,
cs_a, b_ref, cs_b );
computediff<T>( 'c', m, n, b, b_ref, cs_b, thresh );
computediff<T>( "B", 'c', m, n, b, b_ref, cs_b, thresh );
// free memory
free(b_ref);
}
}

View File

@@ -77,7 +77,7 @@ TYPED_TEST(asumv_IIT_ERS_Test, n_lt_zero_nonUnitStride)
asum = asumv<T>( invalid_n, x.data(), inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
// n == 0, with non-unit stride
@@ -102,7 +102,7 @@ TYPED_TEST(asumv_IIT_ERS_Test, n_eq_zero_nonUnitStride)
asum = asumv<T>( invalid_n, x.data(), inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
// n < 0, with unit stride
@@ -127,7 +127,7 @@ TYPED_TEST(asumv_IIT_ERS_Test, n_lt_zero_unitStride)
asum = asumv<T>( invalid_n, x.data(), unit_inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
// n == 0, with unit stride
@@ -152,7 +152,7 @@ TYPED_TEST(asumv_IIT_ERS_Test, n_eq_zero_unitStride)
asum = asumv<T>( invalid_n, x.data(), unit_inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
// inc < 0
@@ -176,7 +176,7 @@ TYPED_TEST(asumv_IIT_ERS_Test, inc_lt_0)
asum = asumv<T>( N, x.data(), invalid_inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
// inc == 0
@@ -200,6 +200,6 @@ TYPED_TEST(asumv_IIT_ERS_Test, inc_eq_0)
asum = asumv<T>( N, x.data(), invalid_inc );
// Computing the difference.
computediff<RT>( asum, asum_ref );
computediff<RT>( "asum", asum, asum_ref );
}
#endif
#endif

View File

@@ -65,7 +65,7 @@ void test_asumv( gtint_t n, gtint_t incx, double thresh )
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<RT>( asum, asum_ref, thresh );
computediff<RT>( "asum", asum, asum_ref, thresh );
}
/**
@@ -103,5 +103,5 @@ void test_asumv( gtint_t n, gtint_t incx, gtint_t xi, double ix_exval,
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<RT>( asum, asum_ref, thresh, true );
}
computediff<RT>( "asum", asum, asum_ref, thresh, true );
}

View File

@@ -59,7 +59,7 @@ TYPED_TEST(nrm2_ERS, zero_n) {
// If "x" is accessed before return then nrm2 would segfault.
blis_norm = nrm2<T>(n, nullptr, incx);
RT ref_norm = testinghelpers::ref_nrm2<T>(n, nullptr, incx);
computediff<RT>(blis_norm, ref_norm);
computediff<RT>("norm", blis_norm, ref_norm);
}
// Edge case where it actually does not return early.
@@ -85,7 +85,7 @@ TYPED_TEST(nrm2_EIC, zero_incx_scalar) {
RT blis_norm = 19.0;
blis_norm = nrm2<T>(n, x.data(), incx);
RT ref_norm = testinghelpers::ref_nrm2<T>(n, x.data(), incx);
computediff<RT>(blis_norm, ref_norm);
computediff<RT>("norm", blis_norm, ref_norm);
}
TYPED_TEST(nrm2_EIC, zero_incx_vectorized) {
@@ -103,7 +103,7 @@ TYPED_TEST(nrm2_EIC, zero_incx_vectorized) {
RT blis_norm = 19.0;
blis_norm = nrm2<T>(n, x.data(), incx);
RT ref_norm = testinghelpers::ref_nrm2<T>(n, x.data(), incx);
computediff<RT>(blis_norm, ref_norm);
computediff<RT>("norm", blis_norm, ref_norm);
}
/*
@@ -126,5 +126,5 @@ TYPED_TEST( nrm2_EIC, zero_incx_MT ) {
x[0] = T{2.0}*x[0];
RT blis_norm = nrm2<T>(n, x.data(), incx);
RT ref_norm = testinghelpers::ref_nrm2<T>(n, x.data(), incx);
computediff<RT>(blis_norm, ref_norm);
computediff<RT>("norm", blis_norm, ref_norm);
}

View File

@@ -57,5 +57,5 @@ TYPED_TEST(nrm2_IIT, negative_n) {
RT blis_norm = -4.2;
blis_norm = nrm2<T>(-2, &x, INC);
computediff<RT>(blis_norm, 0.0);
computediff<RT>("norm", blis_norm, 0.0);
}

View File

@@ -15,7 +15,7 @@ TYPED_TEST(OUT_nrm2, maxFP_scalar) {
T x = T{maxval};
RT norm = nrm2<T>(1, &x, 1);
computediff<RT>(maxval, norm);
computediff<RT>("norm", norm, maxval);
}
TYPED_TEST(OUT_nrm2, maxFP_vectorized) {
using T = TypeParam;
@@ -25,7 +25,7 @@ TYPED_TEST(OUT_nrm2, maxFP_vectorized) {
RT maxval = (std::numeric_limits<RT>::max)();
x[17] = T{maxval};
RT norm = nrm2<T>(n, x.data(), 1);
computediff<RT>(maxval, norm);
computediff<RT>("norm", norm, maxval);
}
// Testing for min representable number to see if underflow is handled correctly.
@@ -36,7 +36,7 @@ TYPED_TEST(OUT_nrm2, minFP_scalar) {
RT minval = (std::numeric_limits<RT>::min)();
T x = T{minval};
RT norm = nrm2<T>(1, &x, 1);
computediff<RT>(minval, norm);
computediff<RT>("norm", norm, minval);
}
TYPED_TEST(OUT_nrm2, minFP_vectorized) {
using T = TypeParam;
@@ -46,7 +46,7 @@ TYPED_TEST(OUT_nrm2, minFP_vectorized) {
RT minval = (std::numeric_limits<RT>::min)();
x[17] = T{minval};
RT norm = nrm2<T>(n, x.data(), 1);
computediff<RT>(minval, norm);
computediff<RT>("norm", norm, minval);
}
// Since there are 2 different paths, vectorized and scalar,
@@ -57,7 +57,7 @@ TYPED_TEST(OUT_nrm2, zeroFP_scalar) {
T x = T{0};
RT norm = nrm2<T>(1, &x, 1);
computediff<RT>(0, norm);
computediff<RT>("norm", norm, 0);
}
TYPED_TEST(OUT_nrm2, zeroFP_vectorized) {
using T = TypeParam;
@@ -66,7 +66,7 @@ TYPED_TEST(OUT_nrm2, zeroFP_vectorized) {
std::vector<T> x(n, T{0});
RT norm = nrm2<T>(n, x.data(), 1);
computediff<RT>(0, norm);
computediff<RT>("norm", norm, 0);
}
/*
@@ -101,7 +101,7 @@ TYPED_TEST( OUT_nrm2, OFlow_MT ) {
RT norm = nrm2<T>( n, x.data(), 1 );
RT ref_norm = testinghelpers::ref_nrm2<T>( n, x.data(), 1 );
computediff<RT>( norm, ref_norm, thresh );
computediff<RT>( "norm", norm, ref_norm, thresh );
}
// Checking only for underflow, based on the threshold
@@ -129,7 +129,7 @@ TYPED_TEST( OUT_nrm2, UFlow_MT ) {
RT norm = nrm2<T>( n, x.data(), 1 );
RT ref_norm = testinghelpers::ref_nrm2<T>( n, x.data(), 1 );
computediff<RT>( norm, ref_norm, thresh );
computediff<RT>( "norm", norm, ref_norm, thresh );
}
// Checking for both overflow and underflow, based on the thresholds
@@ -159,7 +159,7 @@ TYPED_TEST( OUT_nrm2, OUFlow_MT ) {
RT norm = nrm2<T>( n, x.data(), 1 );
RT ref_norm = testinghelpers::ref_nrm2<T>( n, x.data(), 1 );
computediff<RT>( norm, ref_norm, thresh );
computediff<RT>( "norm", norm, ref_norm, thresh );
}
// Specific test case used by an ISV.
@@ -170,8 +170,8 @@ TEST(dnrm2, largeDouble) {
std::vector<T> x{3e300, 4e300}, y{-4e300, -3e300};
T norm = nrm2<T>(n, x.data(), 1);
computediff<T>(5e300, norm);
computediff<T>( "norm", norm, 5e300 );
norm = nrm2<T>(n, y.data(), 1);
computediff<T>(5e300, norm);
computediff<T>( "norm", norm, 5e300 );
}

View File

@@ -63,7 +63,7 @@ void test_nrm2( gtint_t n, gtint_t incx, double thresh )
//----------------------------------------------------------
// Compute error.
//----------------------------------------------------------
computediff<RT>( norm, norm_ref, thresh );
computediff<RT>( "norm", norm, norm_ref, thresh );
}
// Test body used for extreme value testing, where we want to test
@@ -97,5 +97,5 @@ void test_nrm2( gtint_t n, gtint_t incx, gtint_t i, T iexval, gtint_t j = 0, T j
// Compute error.
//----------------------------------------------------------
// Compare using NaN/Inf checks.
computediff<RT>( norm, norm_ref, true );
computediff<RT>( "norm", norm, norm_ref, true );
}