mirror of
https://github.com/amd/blis.git
synced 2026-05-25 02:44:31 +00:00
GTestSuite: Templatizing printing function for test name.
- Using a template class for the printing operator that depends on the type. - USe a macro to denote which interface is being tested. AMD-Internal: [CPUPL-4500] Change-Id: I453c4ef4842c354064f49ff32ec4bf42920cc17c
This commit is contained in:
@@ -96,11 +96,11 @@ foreach(dir ${DIRS})
|
||||
target_link_libraries(${target_name}.${dir}.${subdir} ${ASAN_FLAGS})
|
||||
target_link_libraries(${target_name}.${dir}.${subdir} ${COVERAGE_FLAGS})
|
||||
if(TEST_INTERFACE STREQUAL "BLAS")
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_BLAS)
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_BLAS API_PRINT="blas")
|
||||
elseif(TEST_INTERFACE STREQUAL "CBLAS")
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_CBLAS)
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_CBLAS API_PRINT="cblas")
|
||||
else() # BLIS_TYPED option
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_BLIS_TYPED)
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC TEST_BLIS_TYPED API_PRINT="bli")
|
||||
endif()
|
||||
target_compile_definitions(${target_name}.${dir}.${subdir} PUBLIC ${UKR_DEFINES})
|
||||
if(TEST_UPPERCASE_ARGS)
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( cimatcopyEVT, NanInfCheck )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class cimatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,scomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
scomplex exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -151,7 +111,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{0.0, AOCL_NAN}, scomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::cimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for cimatcopy, with exception values in alpha
|
||||
@@ -172,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::cimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,47 +83,6 @@ TEST_P( cimatcopyAPI, FunctionalTest )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_in_lda_out_{mem_test_enabled/mem_test_disabled}
|
||||
class cimatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_" + std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
char mat_trans = ( ( trans == 'n' ) || ( trans == 'r' ) )? 'n' : 't';
|
||||
gtint_t lda_in = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t lda_out = testinghelpers::get_leading_dimension( storage, mat_trans, m, n, ldb_inc );
|
||||
str_name += "_lda_in_" + std::to_string(lda_in);
|
||||
str_name += "_lda_out_" + std::to_string(lda_out);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of cimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -142,6 +101,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::cimatcopyAPIPrint()
|
||||
::imatcopyGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( dimatcopyEVT, NanInfCheck )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class dimatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,double,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
double exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -149,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::dimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT testing for dimatcopy, with exception values in alpha
|
||||
@@ -169,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::dimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,47 +83,6 @@ TEST_P( dimatcopyAPI, FunctionalTest )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_in_lda_out_{mem_test_enabled/mem_test_disabled}
|
||||
class dimatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_" + std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
char mat_trans = ( ( trans == 'n' ) || ( trans == 'r' ) )? 'n' : 't';
|
||||
gtint_t lda_in = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t lda_out = testinghelpers::get_leading_dimension( storage, mat_trans, m, n, ldb_inc );
|
||||
str_name += "_lda_in_" + std::to_string(lda_in);
|
||||
str_name += "_lda_out_" + std::to_string(lda_out);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of dimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -141,6 +100,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::dimatcopyAPIPrint()
|
||||
::imatcopyGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( simatcopyEVT, NanInfCheck )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class simatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,float,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
float exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -149,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::simatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<float>()
|
||||
);
|
||||
|
||||
// EVT testing for simatcopy, with exception values in alpha
|
||||
@@ -169,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0f), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::simatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,47 +83,6 @@ TEST_P( simatcopyAPI, FunctionalTest )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_in_lda_out_{mem_test_enabled/mem_test_disabled}
|
||||
class simatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_" + std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
char mat_trans = ( ( trans == 'n' ) || ( trans == 'r' ) )? 'n' : 't';
|
||||
gtint_t lda_in = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t lda_out = testinghelpers::get_leading_dimension( storage, mat_trans, m, n, ldb_inc );
|
||||
str_name += "_lda_in_" + std::to_string(lda_in);
|
||||
str_name += "_lda_out_" + std::to_string(lda_out);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of simatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -141,6 +100,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of lda_out
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::simatcopyAPIPrint()
|
||||
::imatcopyGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
@@ -139,3 +139,65 @@ static void test_imatcopy( char storage, char trans, gtint_t m, gtint_t n, T alp
|
||||
computediff<T>( "A", storage, n, m, A, A_ref, lda_out, thresh, is_nan_inf_test );
|
||||
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class imatcopyGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_" + std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
char mat_trans = ( ( trans == 'n' ) || ( trans == 'r' ) )? 'n' : 't';
|
||||
gtint_t lda_in = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t lda_out = testinghelpers::get_leading_dimension( storage, mat_trans, m, n, ldb_inc );
|
||||
str_name += "_lda_in_" + std::to_string(lda_in);
|
||||
str_name += "_lda_out_" + std::to_string(lda_out);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class imatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,T,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
T exval = std::get<7>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval_" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -87,46 +87,6 @@ TEST_P( zimatcopyEVT, NanInfCheck )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class zimatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,dcomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
dcomplex exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -151,7 +111,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, AOCL_NAN}, dcomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<dcomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for zimatcopy, with exception values in alpha
|
||||
@@ -172,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zimatcopyEVTPrint()
|
||||
::imatcopyEVTPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,47 +83,6 @@ TEST_P( zimatcopyAPI, FunctionalTest )
|
||||
test_imatcopy<T>( storage, trans, m, n, alpha, lda_in_inc, lda_out_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_in_lda_out_{mem_test_enabled/mem_test_disabled}
|
||||
class zimatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_" + std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
char mat_trans = ( ( trans == 'n' ) || ( trans == 'r' ) )? 'n' : 't';
|
||||
gtint_t lda_in = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t lda_out = testinghelpers::get_leading_dimension( storage, mat_trans, m, n, ldb_inc );
|
||||
str_name += "_lda_in_" + std::to_string(lda_in);
|
||||
str_name += "_lda_out_" + std::to_string(lda_out);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of zimatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -142,6 +101,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::zimatcopyAPIPrint()
|
||||
::imatcopyGenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( comatcopyEVT, NanInfCheck )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class comatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,scomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
scomplex exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -151,7 +111,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{0.0, AOCL_NAN}, scomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::comatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for comatcopy, with exception values in alpha
|
||||
@@ -172,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::comatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,46 +83,6 @@ TEST_P( comatcopyAPI, FunctionalTest )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class comatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of comatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -141,6 +101,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::comatcopyAPIPrint()
|
||||
::omatcopyGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( domatcopyEVT, NanInfCheck )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class domatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,double,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
double exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -149,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::domatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT testing for domatcopy, with exception values in alpha
|
||||
@@ -169,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::domatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,46 +83,6 @@ TEST_P( domatcopyAPI, FunctionalTest )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class domatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of domatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -140,6 +100,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::domatcopyAPIPrint()
|
||||
::omatcopyGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -87,46 +87,6 @@ TEST_P( somatcopyEVT, NanInfCheck )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class somatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,float,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
float exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -149,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::somatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<float>()
|
||||
);
|
||||
|
||||
// EVT testing for somatcopy, with exception values in alpha
|
||||
@@ -169,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0f), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::somatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,46 +83,6 @@ TEST_P( somatcopyAPI, FunctionalTest )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class somatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of somatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -140,6 +100,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::somatcopyAPIPrint()
|
||||
::omatcopyGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -142,3 +142,63 @@ static void test_omatcopy( char storage, char trans, gtint_t m, gtint_t n, T alp
|
||||
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class omatcopyGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class omatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,T,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
T exval = std::get<7>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval_" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -87,46 +87,6 @@ TEST_P( zomatcopyEVT, NanInfCheck )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class zomatcopyEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,dcomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
dcomplex exval = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -151,7 +111,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, AOCL_NAN}, dcomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zomatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<dcomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for zomatcopy, with exception values in alpha
|
||||
@@ -172,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zomatcopyEVTPrint()
|
||||
::omatcopyEVTPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -83,46 +83,6 @@ TEST_P( zomatcopyAPI, FunctionalTest )
|
||||
test_omatcopy<T>( storage, trans, m, n, alpha, lda_inc, ldb_inc, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class zomatcopyAPIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t ldb_inc = std::get<6>(str.param);
|
||||
bool is_memory_test = std::get<7>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && (defined(REF_IS_MKL) || defined(REF_IS_OPENBLAS))
|
||||
// Black box testing for generic and main use of zomatcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -141,6 +101,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(0), gtint_t(17)), // increment of ldb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::zomatcopyAPIPrint()
|
||||
::omatcopyGenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -93,50 +93,6 @@ TEST_P( comatcopy2EVT, NanInfCheck )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class comatcopy2EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,gtint_t,gtint_t,scomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
scomplex exval = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_stridea" + std::to_string(strideb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -163,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{0.0, AOCL_NAN}, scomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::comatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for comatcopy2, with exception values in alpha
|
||||
@@ -186,6 +142,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::comatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,50 +89,6 @@ TEST_P( comatcopy2API, FunctionalTest )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class comatcopy2APIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,scomplex,gtint_t,gtint_t,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
bool is_memory_test = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_strideb" + std::to_string(strideb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of comatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -153,6 +109,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1), gtint_t(3)), // strideb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::comatcopy2APIPrint()
|
||||
::omatcopy2GenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -93,50 +93,6 @@ TEST_P( domatcopy2EVT, NanInfCheck )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class domatcopy2EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,gtint_t,gtint_t,double,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
double exval = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_stridea" + std::to_string(strideb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
|
||||
static double AOCL_NAN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -161,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::domatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT testing for domatcopy2, with exception values in alpha
|
||||
@@ -183,6 +139,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::domatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,50 +89,6 @@ TEST_P( domatcopy2API, FunctionalTest )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class domatcopy2APIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,double,gtint_t,gtint_t,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
bool is_memory_test = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_strideb" + std::to_string(strideb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of domatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -152,6 +108,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1), gtint_t(3)), // strideb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::domatcopy2APIPrint()
|
||||
::omatcopy2GenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -93,50 +93,6 @@ TEST_P( somatcopy2EVT, NanInfCheck )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class somatcopy2EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,gtint_t,gtint_t,float,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
float exval = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_stridea" + std::to_string(strideb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -161,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(AOCL_NAN, AOCL_INF, -AOCL_INF), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::somatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<float>()
|
||||
);
|
||||
|
||||
// EVT testing for somatcopy2, with exception values in alpha
|
||||
@@ -183,6 +139,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(0.0f), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::somatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,50 +89,6 @@ TEST_P( somatcopy2API, FunctionalTest )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class somatcopy2APIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,float,gtint_t,gtint_t,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
bool is_memory_test = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_strideb" + std::to_string(strideb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of somatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -152,6 +108,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1), gtint_t(3)), // strideb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::somatcopy2APIPrint()
|
||||
::omatcopy2GenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -142,3 +142,72 @@ static void test_omatcopy2( char storage, char trans, gtint_t m, gtint_t n, T al
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class omatcopy2GenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
bool is_memory_test = std::get<9>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_strideb" + std::to_string(strideb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class comatcopy2EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,T,gtint_t,gtint_t,gtint_t,gtint_t,T,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
T exval = std::get<9>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_stridea" + std::to_string(strideb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -93,50 +93,6 @@ TEST_P( zomatcopy2EVT, NanInfCheck )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, false, is_nan_inf_test, exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class zomatcopy2EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,gtint_t,gtint_t,dcomplex,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
dcomplex exval = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name = str_name + "_A_exval" + testinghelpers::get_value_string(exval);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_stridea" + std::to_string(strideb);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
|
||||
static float AOCL_NAN = std::numeric_limits<float>::quiet_NaN();
|
||||
@@ -163,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, AOCL_NAN}, dcomplex{AOCL_NAN, AOCL_INF}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zomatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<dcomplex>()
|
||||
);
|
||||
|
||||
// EVT testing for zomatcopy2, with exception values in alpha
|
||||
@@ -186,6 +142,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}), // exval
|
||||
::testing::Values(true) // is_nan_inf_test
|
||||
),
|
||||
::zomatcopy2EVTPrint()
|
||||
::comatcopy2EVTPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,50 +89,6 @@ TEST_P( zomatcopy2API, FunctionalTest )
|
||||
test_omatcopy2<T>( storage, trans, m, n, alpha, lda_inc, stridea, ldb_inc, strideb, thresh, is_memory_test );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
// The string format is as follows :
|
||||
// {blas_/cblas_/bli_}_storage_trans_m_n_alpha_lda_ldb_{mem_test_enabled/mem_test_disabled}
|
||||
class zomatcopy2APIPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,dcomplex,gtint_t,gtint_t,gtint_t,gtint_t,bool>> str) const {
|
||||
char storage = std::get<0>(str.param);
|
||||
char trans = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t n = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
gtint_t lda_inc = std::get<5>(str.param);
|
||||
gtint_t stridea = std::get<6>(str.param);
|
||||
gtint_t ldb_inc = std::get<7>(str.param);
|
||||
gtint_t strideb = std::get<8>(str.param);
|
||||
bool is_memory_test = std::get<9>(str.param);
|
||||
// Currently, BLIS only has the BLAS standard wrapper for this API.
|
||||
// The CBLAS and BLIS strings are also added here(with macro guards),
|
||||
// in case we add the CBLAS and BLIS wrappers to the library in future.
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += std::string(&storage, 1);
|
||||
str_name += "_" + std::string(&trans, 1);
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
gtint_t lda = testinghelpers::get_leading_dimension( storage, 'n', m, n, lda_inc );
|
||||
gtint_t ldb = testinghelpers::get_leading_dimension( storage, trans, m, n, ldb_inc );
|
||||
str_name += "_lda" + std::to_string(lda);
|
||||
str_name += "_stridea" + std::to_string(stridea);
|
||||
str_name += "_ldb" + std::to_string(ldb);
|
||||
str_name += "_strideb" + std::to_string(strideb);
|
||||
str_name += ( is_memory_test )? "_mem_test_enabled" : "_mem_test_disabled";
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(TEST_BLAS) && defined(REF_IS_MKL)
|
||||
// Black box testing for generic and main use of zomatcopy2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -153,6 +109,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1), gtint_t(3)), // strideb
|
||||
::testing::Values(false, true) // is_memory_test
|
||||
),
|
||||
::zomatcopy2APIPrint()
|
||||
::omatcopy2GenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -73,24 +73,6 @@ TEST_P( caddvGenericTest, RandomData )
|
||||
test_addv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class caddvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_caddv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -102,6 +84,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::caddvGenericTestPrint()
|
||||
::addvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -72,24 +72,6 @@ TEST_P( daddvGenericTest, RandomData )
|
||||
test_addv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class daddvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_daddv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -101,6 +83,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::daddvGenericTestPrint()
|
||||
::addvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -72,24 +72,6 @@ TEST_P( saddvGenericTest, RandomData )
|
||||
test_addv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class saddvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_saddv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -101,6 +83,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::saddvGenericTestPrint()
|
||||
::addvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -68,3 +68,22 @@ void test_addv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, double thresh
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
class addvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -73,24 +73,6 @@ TEST_P( ZAddvGenericTest, RandomData )
|
||||
test_addv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class ZAddvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_zaddv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -102,6 +84,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::ZAddvGenericTestPrint()
|
||||
::addvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -58,28 +58,6 @@ TEST_P( camaxvGeneric, FunctionalTest )
|
||||
test_amaxv<T>( n, incx );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)
|
||||
class camaxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
//Black box testing extended for different range of values
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox_Small_Sizes,
|
||||
@@ -88,7 +66,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(11), 1), // n size of vector takes values from 1 to 11 with step size of 1.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::camaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -98,7 +76,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(100), gtint_t(502), 50), // n size of vector takes values from 100 to 500 with step size of 50.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::camaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -108,7 +86,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1024), gtint_t(65535), 1023), // n size of vector takes values from 2pow10 to 2pow16-1 with step size of 1023.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::camaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
//Non unit testing extended for different stride values
|
||||
@@ -119,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(123), gtint_t(111), gtint_t(20)), // m size of vector
|
||||
::testing::Values(gtint_t(4), gtint_t(7)) // stride size for x
|
||||
),
|
||||
::camaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -129,5 +107,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(10), 1), // n size of vector takes values from 1 to 10 with step size 1
|
||||
::testing::Values(gtint_t(11)) // stride size for x
|
||||
),
|
||||
::camaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
@@ -70,34 +70,6 @@ TEST_P( damaxvEVT, NaNInfCheck )
|
||||
test_amaxv<T>( n, incx, xi, xi_exval, xj, xj_exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)_X_(xi)_(xexval)
|
||||
class damaxvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t,gtint_t,double,gtint_t,double>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
gtint_t xi = std::get<2>(str.param);
|
||||
double xi_exval = std::get<3>(str.param);
|
||||
gtint_t xj = std::get<4>(str.param);
|
||||
double xj_exval = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi) + "_" + testinghelpers::get_value_string(xi_exval);
|
||||
str_name = str_name + "_" + std::to_string(xj) + "_" + testinghelpers::get_value_string(xj_exval);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -161,7 +133,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(163), gtint_t(170), gtint_t(172)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, double(2.3)) // xj_exval
|
||||
),
|
||||
::damaxvEVTPrint()
|
||||
::amaxvEVTPrint<double>()
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -204,7 +176,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(327), gtint_t(366)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, double(2.3)) // xj_exval
|
||||
),
|
||||
::damaxvEVTPrint()
|
||||
::amaxvEVTPrint<double>()
|
||||
);
|
||||
|
||||
|
||||
@@ -220,5 +192,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(5), gtint_t(9)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, double(2.3)) // xj_exval
|
||||
),
|
||||
::damaxvEVTPrint()
|
||||
::amaxvEVTPrint<double>()
|
||||
);
|
||||
|
||||
@@ -58,28 +58,6 @@ TEST_P( damaxvGeneric, FunctionalTest )
|
||||
test_amaxv<T>( n, incx );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)
|
||||
class damaxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
//Black box testing extended for different range of values
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox_Small_Sizes,
|
||||
@@ -88,7 +66,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(11), 1), // n size of vector takes values from 1 to 11 with step size of 1.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::damaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -98,7 +76,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(100), gtint_t(502), 50), // n size of vector takes values from 100 to 500 with step size of 50.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::damaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -108,7 +86,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1024), gtint_t(65535), 1023), // n size of vector takes values from 2pow10 to 2pow16-1 with step size of 1023.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::damaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
//Non unit testing extended for different stride values
|
||||
@@ -119,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(123), gtint_t(111), gtint_t(20)), // m size of vector
|
||||
::testing::Values(gtint_t(4), gtint_t(8)) // stride size for x
|
||||
),
|
||||
::damaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -129,6 +107,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(10), 1), // n size of vector takes values from 1 to 10 with step size 1
|
||||
::testing::Values(gtint_t(11)) // stride size for x
|
||||
),
|
||||
::damaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
|
||||
@@ -70,34 +70,6 @@ TEST_P( samaxvEVT, NaNInfCheck )
|
||||
test_amaxv<T>( n, incx, xi, xi_exval, xj, xj_exval );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)_X_(xi)_(xexval)
|
||||
class samaxvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t,gtint_t,float,gtint_t,float>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
gtint_t xi = std::get<2>(str.param);
|
||||
float xi_exval = std::get<3>(str.param);
|
||||
gtint_t xj = std::get<4>(str.param);
|
||||
float xj_exval = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi) + "_" + testinghelpers::get_value_string(xi_exval);
|
||||
str_name = str_name + "_" + std::to_string(xj) + "_" + testinghelpers::get_value_string(xj_exval);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static float NaN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float Inf = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -136,7 +108,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(50), gtint_t(60)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, float(2.3)) // xj_exval
|
||||
),
|
||||
::samaxvEVTPrint()
|
||||
::amaxvEVTPrint<float>()
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -179,7 +151,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(447), gtint_t(450)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, float(2.3)) // xj_exval
|
||||
),
|
||||
::samaxvEVTPrint()
|
||||
::amaxvEVTPrint<float>()
|
||||
);
|
||||
|
||||
|
||||
@@ -195,5 +167,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1), gtint_t(9)), // xj, index for exval in xj_exval
|
||||
::testing::Values(NaN, -Inf, Inf, float(2.3)) // xj_exval
|
||||
),
|
||||
::samaxvEVTPrint()
|
||||
::amaxvEVTPrint<float>()
|
||||
);
|
||||
|
||||
@@ -58,28 +58,6 @@ TEST_P( samaxvGeneric, FunctionalTest )
|
||||
test_amaxv<T>( n, incx );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)
|
||||
class samaxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
//Black box testing extended for different range of values
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox_Small_Size,
|
||||
@@ -88,7 +66,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(11), 1), // n size of vector takes values from 1 to 11 with step size of 1.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::samaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -98,7 +76,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(100), gtint_t(502), 50), // n size of vector takes values from 100 to 500 with step size of 50.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::samaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -108,7 +86,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1024), gtint_t(65535), 1023), // n size of vector takes values from 2pow10 to 2pow16-1 with step size of 1023.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::samaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
//Non unit testing extended for different stride values
|
||||
@@ -119,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(123), gtint_t(111), gtint_t(20)), // m size of vector
|
||||
::testing::Values(gtint_t(4), gtint_t(8)) // stride size for x
|
||||
),
|
||||
::samaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -129,5 +107,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(10), 1), // n size of vector takes values from 1 to 10 with step size 1
|
||||
::testing::Values(gtint_t(11)) // stride size for x
|
||||
),
|
||||
::samaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
@@ -101,3 +101,39 @@ static void test_amaxv( gtint_t n, gtint_t incx, gtint_t xi, T xi_exval,
|
||||
//----------------------------------------------------------
|
||||
computediff<gtint_t>( "idx", idx, idx_ref );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
class amaxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class amaxvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t,gtint_t,T,gtint_t,T>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
gtint_t xi = std::get<2>(str.param);
|
||||
T xi_exval = std::get<3>(str.param);
|
||||
gtint_t xj = std::get<4>(str.param);
|
||||
T xj_exval = std::get<5>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi) + "_" + testinghelpers::get_value_string(xi_exval);
|
||||
str_name = str_name + "_" + std::to_string(xj) + "_" + testinghelpers::get_value_string(xj_exval);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -58,28 +58,6 @@ TEST_P( zamaxvGeneric, FunctionalTest )
|
||||
test_amaxv<T>( n, incx );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_incx(m)(abs_incx)
|
||||
class zamaxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,gtint_t>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
gtint_t incx = std::get<1>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
//Black box testing extended for different range of values
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox_Small_Sizes,
|
||||
@@ -88,7 +66,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(11), 1), // n size of vector takes values from 1 to 11 with step size of 1.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::zamaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -98,7 +76,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(100), gtint_t(502), 50), // n size of vector takes values from 100 to 500 with step size of 50.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::zamaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -108,7 +86,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1024), gtint_t(65535), 1023), // n size of vector takes values from 2pow10 to 2pow16-1 with step size of 1023.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::zamaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
//Non unit testing extended for different stride values
|
||||
@@ -119,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(123), gtint_t(111), gtint_t(20)), // m size of vector
|
||||
::testing::Values(gtint_t(4), gtint_t(8)) // stride size for x
|
||||
),
|
||||
::zamaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -129,5 +107,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(1), gtint_t(10), 1), // n size of vector takes values from 1 to 10 with step size 1
|
||||
::testing::Values(gtint_t(11)) // stride size for x
|
||||
),
|
||||
::zamaxvGenericPrint()
|
||||
::amaxvGenericPrint()
|
||||
);
|
||||
|
||||
@@ -106,37 +106,6 @@ TEST_P( caxpbyvGenericTest, RandomData )
|
||||
test_axpbyv<T>( conj_x, n, incx, incy, alpha, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class caxpbyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,scomplex,scomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
scomplex beta = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "caxpby_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_caxpby";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_caxpbyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of caxpby.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -153,7 +122,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{2.0, -1.0}, scomplex{-2.0, 3.0}), // alpha
|
||||
::testing::Values(scomplex{1.0, 2.0}) // beta
|
||||
),
|
||||
::caxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -174,7 +143,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{4.0, 3.1}), // alpha
|
||||
::testing::Values(scomplex{1.0, -2.0}) // beta
|
||||
),
|
||||
::caxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -192,6 +161,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{4.0, 3.1}), // alpha
|
||||
::testing::Values(scomplex{1.0, -2.0}) // beta
|
||||
),
|
||||
::caxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -119,80 +119,6 @@ TEST_P(daxpbyvEVT, ExceptionData)
|
||||
yj, yexval, thresh);
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)_alpha(alpha_val)_beta(beta_val)
|
||||
class daxpbyvEVTVecPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, double, gtint_t, double, double, double>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
double xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
double yexval = std::get<7>(str.param);
|
||||
double alpha = std::get<8>(str.param);
|
||||
double beta = std::get<9>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)_beta(beta_val)
|
||||
class daxpbyvAlphaBetaPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, double, gtint_t, double, double, double>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
double alpha = std::get<8>(str.param);
|
||||
double beta = std::get<9>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "daxpby_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_daxpby";
|
||||
#else // #elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_daxpbyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -244,7 +170,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)), // alpha
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(4.5)) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -268,7 +194,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)), // alpha
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(4.5)) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -293,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)), // alpha
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(4.5)) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on vectors) with non-unit strides
|
||||
// We have to test a single scalar loop. The indices are such
|
||||
@@ -318,7 +244,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)), // alpha
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(4.5)) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
/*
|
||||
Exception value testing on alpha and/or beta :
|
||||
@@ -352,7 +278,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf, 2.3), // alpha
|
||||
::testing::Values(NaN, -Inf, Inf, -1.9) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on alpha/beta) with non-unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -375,4 +301,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf, 2.3), // alpha
|
||||
::testing::Values(NaN, -Inf, Inf, -1.9) // beta
|
||||
),
|
||||
::daxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<double>());
|
||||
|
||||
@@ -105,37 +105,6 @@ TEST_P( daxpbyvGenericTest, RandomData )
|
||||
test_axpbyv<T>( conj_x, n, incx, incy, alpha, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class daxpbyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,double,double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
double beta = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of daxpby.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -150,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(-4.9), double(1.0),
|
||||
double(-1.0), double(0.0)) // beta
|
||||
),
|
||||
::daxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<double>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -170,7 +139,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(-4.9), double(1.0),
|
||||
double(-1.0), double(0.0)) // beta
|
||||
),
|
||||
::daxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -194,7 +163,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(-4.9), double(1.0),
|
||||
double(-1.0), double(0.0)) // beta
|
||||
),
|
||||
::daxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<double>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -214,6 +183,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(-4.9), double(1.0),
|
||||
double(-1.0), double(0.0)) // beta
|
||||
),
|
||||
::daxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -105,37 +105,6 @@ TEST_P( saxpbyvGenericTest, RandomData )
|
||||
test_axpbyv<T>( conj_x, n, incx, incy, alpha, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class saxpbyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,float,float>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
float beta = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "saxpby_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_saxpby";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_saxpbyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of caxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -148,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(2.0), float(-2.0)), // alpha
|
||||
::testing::Values(float(-1.0)) // beta
|
||||
),
|
||||
::saxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<float>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -166,7 +135,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(2.0)), // alpha
|
||||
::testing::Values(float(1.0)) // beta
|
||||
),
|
||||
::saxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -184,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(4.0)), // alpha
|
||||
::testing::Values(float(2.0)) // beta
|
||||
),
|
||||
::saxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<float>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -202,6 +171,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(4.0), // alpha
|
||||
::testing::Values(-2.0) // beta
|
||||
),
|
||||
::saxpbyvGenericTestPrint()
|
||||
::axpbyvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -106,3 +106,62 @@ static void test_axpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class axpbyvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,T,T>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
T beta = std::get<5>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class axpbyvEVTPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, T, gtint_t, T, T, T>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
T xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
T yexval = std::get<7>(str.param);
|
||||
T alpha = std::get<8>(str.param);
|
||||
T beta = std::get<9>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -119,80 +119,6 @@ TEST_P( zaxpbyvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh);
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_Y_(yi)_(yexval)_alpha(alpha_val)_beta(beta_val)
|
||||
class zaxpbyvEVTVecPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, dcomplex, gtint_t, dcomplex, dcomplex, dcomplex>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
dcomplex xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
dcomplex yexval = std::get<7>(str.param);
|
||||
dcomplex alpha = std::get<8>(str.param);
|
||||
dcomplex beta = std::get<9>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha and/or beta have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)_beta(beta_val)
|
||||
class zaxpbyvAlphaBetaPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, dcomplex, gtint_t, dcomplex, dcomplex, dcomplex>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<8>(str.param);
|
||||
dcomplex beta = std::get<9>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -261,7 +187,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -291,7 +217,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -324,7 +250,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on vectors) with non-unit strides
|
||||
// We have to test a single scalar loop. The indices are such
|
||||
@@ -359,7 +285,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
/*
|
||||
Exception value testing on alpha and beta :
|
||||
@@ -393,7 +319,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{4.5, -Inf}, dcomplex{NaN, Inf},
|
||||
dcomplex{2.3, -3.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on alpha) with non-unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -422,4 +348,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{4.5, -Inf}, dcomplex{NaN, Inf},
|
||||
dcomplex{2.3, -3.7}) // beta
|
||||
),
|
||||
::zaxpbyvEVTVecPrint());
|
||||
::axpbyvEVTPrint<dcomplex>());
|
||||
|
||||
@@ -106,39 +106,6 @@ TEST_P(zaxpbyvAccTest, RandomData)
|
||||
test_axpbyv<T>(conj_x, n, incx, incy, alpha, beta, thresh);
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zaxpbyvAccTestPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, dcomplex, dcomplex>> str) const
|
||||
{
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
dcomplex beta = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "zaxpby_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_zaxpby";
|
||||
#else // #elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_zaxpbyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
The code structure for bli_zaxpbyv_zen_int( ... ) is as follows :
|
||||
For unit strides :
|
||||
@@ -169,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{2.2, -3.3}), // alpha
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{1.0, 2.0}) // beta
|
||||
),
|
||||
::zaxpbyvAccTestPrint());
|
||||
::axpbyvGenericPrint<dcomplex>());
|
||||
|
||||
// Accuracy testing of different combinations of fringe loops(L6, L4, L2, 1)
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -188,7 +155,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{2.2, -3.3}), // alpha
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{1.0, 2.0}) // beta
|
||||
),
|
||||
::zaxpbyvAccTestPrint());
|
||||
::axpbyvGenericPrint<dcomplex>());
|
||||
|
||||
// Accuracy testing of 3*L8 + L6 + L4 + L2 + 1, a case of main + all fringe cases taken
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -207,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{2.2, -3.3}), // alpha
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{1.0, 2.0}) // beta
|
||||
),
|
||||
::zaxpbyvAccTestPrint());
|
||||
::axpbyvGenericPrint<dcomplex>());
|
||||
|
||||
// Accuracy testing with non-unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -234,4 +201,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{2.2, -3.3}), // alpha
|
||||
::testing::Values(dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0}, dcomplex{1.0, 2.0}) // beta
|
||||
),
|
||||
::zaxpbyvAccTestPrint());
|
||||
::axpbyvGenericPrint<dcomplex>());
|
||||
|
||||
@@ -92,39 +92,6 @@ TEST_P( daxpyfGenericTest, FunctionalTest )
|
||||
test_axpyf<T>( conjx, conja, m, b, &alpha, inca, lda, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details
|
||||
class daxpyfGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,
|
||||
char,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
double,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t>> str) const {
|
||||
char conja = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t b = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t incx = std::get<7>(str.param);
|
||||
gtint_t incy = std::get<8>(str.param);
|
||||
|
||||
std::string str_name = "bli_";
|
||||
str_name += ( conja == 'n' )? "_conja_n" : "_conja_t";
|
||||
str_name += ( conjx == 'n' )? "_conjx_n" : "_conjx_t";
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_b_" + std::to_string(b);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of daxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FunctionalTest,
|
||||
@@ -140,6 +107,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::daxpyfGenericTestPrint()
|
||||
::axpyfGenericPrint<double>()
|
||||
);
|
||||
|
||||
|
||||
@@ -91,3 +91,38 @@ static void test_axpyf(
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", m, y.data(), y_ref.data(), incy, thresh, true );
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details
|
||||
template <typename T>
|
||||
class axpyfGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,
|
||||
char,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
T,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t>> str) const {
|
||||
char conja = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t b = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t incx = std::get<7>(str.param);
|
||||
gtint_t incy = std::get<8>(str.param);
|
||||
|
||||
std::string str_name = "bli_";
|
||||
str_name += ( conja == 'n' )? "_conja_n" : "_conja_t";
|
||||
str_name += ( conjx == 'n' )? "_conjx_n" : "_conjx_t";
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_b_" + std::to_string(b);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -81,35 +81,6 @@ TEST_P( caxpyvGenericTest, RandomData )
|
||||
test_axpyv<T>( conj_x, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class caxpyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,scomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "caxpy_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_caxpy";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_caxpyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of caxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -125,7 +96,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(scomplex{2.0, -1.0}, scomplex{-2.0, 3.0}) // alpha
|
||||
),
|
||||
::caxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -145,7 +116,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(3)), // stride size for y
|
||||
::testing::Values(scomplex{4.0, 3.1}) // alpha
|
||||
),
|
||||
::caxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -162,6 +133,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-3)), // stride size for y
|
||||
::testing::Values(scomplex{4.0, 3.1}) // alpha
|
||||
),
|
||||
::caxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -94,76 +94,6 @@ TEST_P(daxpyvEVT, ExceptionData)
|
||||
yj, yexval, thresh);
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)_alpha(alpha_val)
|
||||
class daxpyvEVTVecPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, double, gtint_t, double, double>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
double xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
double yexval = std::get<7>(str.param);
|
||||
double alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class daxpyvAlphaBetaPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, double, gtint_t, double, double>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
double alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "daxpy_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_daxpy";
|
||||
#else // #elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_daxpyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -229,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0)), // dummy value on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -253,7 +183,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -279,7 +209,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
/*
|
||||
Exception value testing on vectors(Zen4) :
|
||||
@@ -332,7 +262,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0)), // dummy value on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -356,7 +286,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -382,7 +312,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on vectors) with non-unit strides
|
||||
// We have to test a single scalar loop. The indices are such
|
||||
@@ -406,7 +336,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf, -1.5), // exception values to set on y
|
||||
::testing::Values(double(0.0), double(1.0), double(-1.0), double(-3.3)) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
/*
|
||||
Exception value testing on alpha :
|
||||
@@ -436,7 +366,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on alpha) with unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -458,7 +388,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
// Exception value testing(on alpha) with non-unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -480,4 +410,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::daxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<double>());
|
||||
|
||||
@@ -80,34 +80,6 @@ TEST_P( daxpyvGenericTest, RandomData )
|
||||
test_axpyv<T>( conj_x, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class daxpyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of daxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -120,7 +92,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -138,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -156,7 +128,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -174,7 +146,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -200,7 +172,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
|
||||
// Checking for the thresholds with non-unit strides
|
||||
@@ -222,6 +194,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(0.0), double(1.0),
|
||||
double(-1.0), double(4.1)) // alpha
|
||||
),
|
||||
::daxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -92,76 +92,6 @@ TEST_P( saxpyvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh);
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)_alpha(alpha_val)
|
||||
class saxpyvEVTVecPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, float, gtint_t, float, float>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
float xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
float yexval = std::get<7>(str.param);
|
||||
float alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class saxpyvAlphaBetaPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, float, gtint_t, float, float>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
float alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static float NaN = std::numeric_limits<float>::quiet_NaN();
|
||||
static float Inf = std::numeric_limits<float>::infinity();
|
||||
|
||||
@@ -222,7 +152,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(0.0)), // dummy value on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -246,7 +176,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -272,7 +202,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
/*
|
||||
Exception value testing on vectors(Zen4) :
|
||||
@@ -325,7 +255,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(0.0)), // dummy value on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -349,7 +279,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -375,7 +305,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf), // exception values to set on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on vectors) with non-unit strides
|
||||
// We have to test a single scalar loop. The indices are such
|
||||
@@ -399,7 +329,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(NaN, -Inf, Inf, -1.5), // exception values to set on y
|
||||
::testing::Values(float(0.0), float(1.0), float(-1.0), float(-3.3)) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
/*
|
||||
Exception value testing on alpha :
|
||||
@@ -429,7 +359,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on alpha) with unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -451,7 +381,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
// Exception value testing(on alpha) with non-unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -473,4 +403,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(0.0)),
|
||||
::testing::Values(NaN, -Inf, Inf) // alpha
|
||||
),
|
||||
::saxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<float>());
|
||||
|
||||
@@ -80,34 +80,6 @@ TEST_P( saxpyvGeneric, FunctionalTest )
|
||||
test_axpyv<T>( conj_x, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class saxpyvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,float>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of saxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
unitStrides,
|
||||
@@ -119,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(float(2.0), float(-2.0)) // alpha
|
||||
),
|
||||
::saxpyvGenericPrint()
|
||||
::axpyvGenericPrint<float>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -137,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(2.5), float(1.0),
|
||||
float(-1.0), float(0.0)) // alpha
|
||||
),
|
||||
::saxpyvGenericPrint()
|
||||
::axpyvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -155,7 +127,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(2.5), float(1.0),
|
||||
float(-1.0), float(0.0)) // alpha
|
||||
),
|
||||
::saxpyvGenericPrint()
|
||||
::axpyvGenericPrint<float>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -173,6 +145,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(float(2.5), float(1.0),
|
||||
float(-1.0), float(0.0)) // alpha
|
||||
),
|
||||
::saxpyvGenericPrint()
|
||||
::axpyvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -106,3 +106,58 @@ static void test_axpyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class axpyvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,T>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class axpyvEVTPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, T, gtint_t, T, T>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
T xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
T yexval = std::get<7>(str.param);
|
||||
T alpha = std::get<8>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -97,76 +97,6 @@ TEST_P( zaxpyvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh);
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)_alpha(alpha_val)
|
||||
class zaxpyvEVTVecPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, dcomplex, gtint_t, dcomplex, dcomplex>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
dcomplex xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
dcomplex yexval = std::get<7>(str.param);
|
||||
dcomplex alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class zaxpyvAlphaBetaPrint
|
||||
{
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, dcomplex, gtint_t, dcomplex, dcomplex>> str) const
|
||||
{
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<8>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -229,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -257,7 +187,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -288,7 +218,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on vectors) with non-unit strides
|
||||
// We have to test a single scalar loop. The indices are such
|
||||
@@ -320,7 +250,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-1.0, 0.0}, dcomplex{0.0, 1.0},
|
||||
dcomplex{0.0, -1.0}, dcomplex{-3.3, 1.7}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
/*
|
||||
Exception value testing on alpha :
|
||||
@@ -353,7 +283,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, Inf}, dcomplex{-2.3, NaN},
|
||||
dcomplex{4.5, -Inf}, dcomplex{NaN, Inf}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
// Exception value testing(on alpha) with non-unit strided vectors
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -377,4 +307,4 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, Inf}, dcomplex{-2.3, NaN},
|
||||
dcomplex{4.5, -Inf}, dcomplex{NaN, Inf}) // alpha
|
||||
),
|
||||
::zaxpyvEVTVecPrint());
|
||||
::axpyvEVTPrint<dcomplex>());
|
||||
|
||||
@@ -81,34 +81,6 @@ TEST_P( zaxpyvGenericTest, FunctionalTest )
|
||||
test_axpyv<T>( conj_x, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when alpha/beta have exception value.
|
||||
// The string format is as follows :
|
||||
// {blas/cblas/blis}_n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_alpha(alpha_val)
|
||||
class zaxpyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t,dcomplex>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of zaxpy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
unitStrides,
|
||||
@@ -126,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0},
|
||||
dcomplex{-1.0, 0.0}) // alpha
|
||||
),
|
||||
::zaxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -148,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0},
|
||||
dcomplex{-1.0, 0.0}) // alpha
|
||||
),
|
||||
::zaxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -167,6 +139,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{0.0, 0.0}, dcomplex{1.0, 0.0},
|
||||
dcomplex{-1.0, 0.0}) // alpha
|
||||
),
|
||||
::zaxpyvGenericTestPrint()
|
||||
::axpyvGenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -64,33 +64,6 @@ TEST_P( ccopyvGenericTest, RandomData )
|
||||
test_copyv<T>( conjx, n, incx, incy );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class ccopyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "ccopy_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_ccopy";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_ccopyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of ccopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -105,7 +78,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::ccopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -124,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::ccopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -140,6 +113,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-5), gtint_t(7)), // stride size for x
|
||||
::testing::Values(gtint_t(13), gtint_t(-9)) // stride size for y
|
||||
),
|
||||
::ccopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -64,33 +64,6 @@ TEST_P( dcopyvGenericTest, RandomData )
|
||||
test_copyv<T>( conjx, n, incx, incy );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class dcopyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of scopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -101,7 +74,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::dcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED // BLIS-api specific
|
||||
@@ -117,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::dcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -133,7 +106,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::dcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -149,6 +122,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-5), gtint_t(7)), // stride size for x
|
||||
::testing::Values(gtint_t(13), gtint_t(-9)) // stride size for y
|
||||
),
|
||||
::dcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -64,33 +64,6 @@ TEST_P( scopyvGenericTest, RandomData )
|
||||
test_copyv<T>( conjx, n, incx, incy );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class scopyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "scopy_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_scopy";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_scopyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of scopyv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -101,7 +74,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::scopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED // BLIS-api specific
|
||||
@@ -117,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::scopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -133,7 +106,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::scopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -149,6 +122,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-5), gtint_t(7)), // stride size for x
|
||||
::testing::Values(gtint_t(13), gtint_t(-9)) // stride size for y
|
||||
),
|
||||
::scopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -69,3 +69,22 @@ static void test_copyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy )
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
class copyvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -64,33 +64,6 @@ TEST_P( zcopyvGenericTest, RandomData )
|
||||
test_copyv<T>( conjx, n, incx, incy );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zcopyvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "zcopy_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_zcopy";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_zcopyv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of zcopy.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -105,7 +78,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::zcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -124,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::zcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -140,6 +113,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-5), gtint_t(7)), // stride size for x
|
||||
::testing::Values(gtint_t(13), gtint_t(-9)) // stride size for y
|
||||
),
|
||||
::zcopyvGenericTestPrint()
|
||||
::copyvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -78,35 +78,6 @@ TEST_P( cdotvGenericTest, RandomData )
|
||||
test_dotv<T>( conjx, conjy, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class cdotvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "cdotu_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_cdotu_sub";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_cdotv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of cdot.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -126,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::cdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -150,7 +121,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3)) // stride size for y
|
||||
),
|
||||
::cdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -167,6 +138,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-2)), // stride size for x
|
||||
::testing::Values(gtint_t(-3)) // stride size for y
|
||||
),
|
||||
::cdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -86,44 +86,6 @@ TEST_P( ddotv_EVT, ExceptionData )
|
||||
test_dotv<T>( conjx, conjy, n, incx, xi, x_exval, incy, yi, y_exval, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class ddotv_EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t, double, gtint_t, gtint_t, double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
double x_exval = std::get<5>(str.param);
|
||||
gtint_t incy = std::get<6>(str.param);
|
||||
gtint_t yi = std::get<7>(str.param);
|
||||
double y_exval = std::get<8>(str.param);
|
||||
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "ddot_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_ddot";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_ddotv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += (conjy == 'n') ? "_noconjy" : "_conjy";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name = str_name + "_Y_" + std::to_string(yi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(y_exval);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
@@ -184,7 +146,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( double(0.0) ) // dummy value since testing only for x
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
|
||||
@@ -226,7 +188,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT with unit stride vectors X and Y contatining Infs/NaNs.
|
||||
@@ -271,7 +233,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// Tests for Zen3 Architecture.
|
||||
@@ -343,7 +305,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( double(0.0) ) // dummy value since testing only for x
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT with unit stride Y vector containing Infs/NaNs.
|
||||
@@ -387,7 +349,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT with unit stride vectors X and Y contatining Infs/NaNs.
|
||||
@@ -433,7 +395,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT with non-unit stride vectors X and Y containing Infs/NaNs.
|
||||
@@ -470,7 +432,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// EVT with negative stride vectors X and Y containing Infs/NaNs.
|
||||
@@ -507,5 +469,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// y_exval: extreme value for y.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::ddotv_EVTPrint()
|
||||
::dotvEVTPrint<double>()
|
||||
);
|
||||
|
||||
@@ -77,35 +77,6 @@ TEST_P( ddotvGenericTest, RandomData )
|
||||
test_dotv<T>( conjx, conjy, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class ddotvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "ddot_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_ddot";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_ddotv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += (conjy == 'n') ? "_noconjy" : "_conjy";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic use of ddot.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
unitPositiveStride,
|
||||
@@ -122,7 +93,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// incy: stride of y vector.
|
||||
::testing::Values(gtint_t(1)) // unit stride
|
||||
),
|
||||
::ddotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED // BLIS-api specific
|
||||
@@ -139,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::ddotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -165,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(3), gtint_t(7) // few non-unit positive strides for sanity check
|
||||
)
|
||||
),
|
||||
::ddotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -191,7 +162,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(-1), gtint_t(-3), gtint_t(-7) // few non-unit negative strides for sanity check
|
||||
)
|
||||
),
|
||||
::ddotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -222,6 +193,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1) // unit stride
|
||||
)
|
||||
),
|
||||
::ddotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -77,35 +77,6 @@ TEST_P( sdotvGenericTest, RandomData )
|
||||
test_dotv<T>( conjx, conjy, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class sdotvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "sdot_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_sdot";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_sdotv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of sdotv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -117,7 +88,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::sdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED // BLIS-api specific
|
||||
@@ -134,7 +105,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::sdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -151,7 +122,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::sdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -168,6 +139,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-2)), // stride size for x
|
||||
::testing::Values(gtint_t(-3)) // stride size for y
|
||||
),
|
||||
::sdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -121,3 +121,55 @@ static void test_dotv( char conjx, char conjy, gtint_t n,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "rho", rho, rho_ref, thresh, true);
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
class dotvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class dotvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t, T, gtint_t, gtint_t, T>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
T x_exval = std::get<5>(str.param);
|
||||
gtint_t incy = std::get<6>(str.param);
|
||||
gtint_t yi = std::get<7>(str.param);
|
||||
T y_exval = std::get<8>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += (conjy == 'n') ? "_noconjy" : "_conjy";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name = str_name + "_Y_" + std::to_string(yi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(y_exval);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,35 +78,6 @@ TEST_P( zdotvGenericTest, RandomData )
|
||||
test_dotv<T>( conjx, conjy, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zdotvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
char conjy = std::get<1>(str.param);
|
||||
gtint_t n = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "zdotu_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_zdotu_sub";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_zdotv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of zdot.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -126,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::zdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -150,7 +121,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), // stride size for x
|
||||
::testing::Values(gtint_t(3), gtint_t(33)) // stride size for y
|
||||
),
|
||||
::zdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -167,6 +138,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-2)), // stride size for x
|
||||
::testing::Values(gtint_t(-3)) // stride size for y
|
||||
),
|
||||
::zdotvGenericTestPrint()
|
||||
::dotvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -106,43 +106,6 @@ TEST_P( ddotxffGenericTest, FunctionalTest )
|
||||
test_dotxf<T>( conjx, conja, m, b, &alpha, inca, lda, incx, &beta, incy, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details
|
||||
class ddotxfGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,
|
||||
char,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
double,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
double,
|
||||
gtint_t>> str) const {
|
||||
char conja = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t b = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
gtint_t incx = std::get<7>(str.param);
|
||||
double beta = std::get<8>(str.param);
|
||||
gtint_t incy = std::get<9>(str.param);
|
||||
|
||||
std::string str_name = "bli_";
|
||||
|
||||
str_name += ( conja == 'n' )? "_conja_n" : "_conja_t";
|
||||
str_name += ( conjx == 'n' )? "_conjx_n" : "_conjx_t";
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_b_" + std::to_string(b);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of ddotxf.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
FunctionalTest,
|
||||
@@ -159,6 +122,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(double(1.0)), // beta
|
||||
::testing::Values(gtint_t(1)) // stride size for y
|
||||
),
|
||||
::ddotxfGenericTestPrint()
|
||||
::dotxfGenericPrint<double>()
|
||||
);
|
||||
|
||||
|
||||
@@ -87,3 +87,42 @@ static void test_dotxf(
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", m, y.data(), y_ref.data(), incy, thresh, true );
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details
|
||||
template <typename T>
|
||||
class dotxfGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,
|
||||
char,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
T,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
gtint_t,
|
||||
T,
|
||||
gtint_t>> str) const {
|
||||
char conja = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
gtint_t m = std::get<2>(str.param);
|
||||
gtint_t b = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
gtint_t incx = std::get<7>(str.param);
|
||||
T beta = std::get<8>(str.param);
|
||||
gtint_t incy = std::get<9>(str.param);
|
||||
|
||||
std::string str_name = "bli_";
|
||||
|
||||
str_name += ( conja == 'n' )? "_conja_n" : "_conja_t";
|
||||
str_name += ( conjx == 'n' )? "_conjx_n" : "_conjx_t";
|
||||
str_name += "_m_" + std::to_string(m);
|
||||
str_name += "_b_" + std::to_string(b);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -105,33 +105,6 @@ TEST_P( cdotxvGenericTest, RandomData )
|
||||
test_dotxv<T>( n, conj_x, conj_y, alpha, incx, incy, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class cdotxvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,char,char,gtint_t,gtint_t,scomplex,scomplex>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
char conjy = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
scomplex alpha = std::get<5>(str.param);
|
||||
scomplex beta = std::get<6>(str.param);
|
||||
std::string str_name = "bli_cdotxv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of cdotxv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -146,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{1.0, -1.0}), // alpha
|
||||
::testing::Values(scomplex{-1.0, 1.0}) // beta
|
||||
),
|
||||
::cdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Black box testing for generic and main use of cdotxv.
|
||||
@@ -162,7 +135,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{1.0, -1.0}), // alpha
|
||||
::testing::Values(scomplex{-1.0, 1.0}) // beta
|
||||
),
|
||||
::cdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -180,6 +153,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(scomplex{1.0, -1.0}), // alpha
|
||||
::testing::Values(scomplex{-1.0, 1.0}) // beta
|
||||
),
|
||||
::cdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -104,33 +104,6 @@ TEST_P( ddotxvGenericTest, RandomData )
|
||||
test_dotxv<T>(n, conj_x, conj_y, alpha, incx, incy, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class ddotxvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,char,char,gtint_t,gtint_t,double,double>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
char conjy = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
double alpha = std::get<5>(str.param);
|
||||
double beta = std::get<6>(str.param);
|
||||
std::string str_name = "bli_ddotxv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of ddotxv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -145,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::ddotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<double>()
|
||||
);
|
||||
|
||||
// Test when conjugate of x is used as an argument.
|
||||
@@ -163,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::ddotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<double>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -181,6 +154,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::ddotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -104,33 +104,6 @@ TEST_P( sdotxvGenericTest, RandomData )
|
||||
test_dotxv<T>( n, conj_x, conj_y, alpha, incx, incy, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class sdotxvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,char,char,gtint_t,gtint_t,float,float>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
char conjy = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
float alpha = std::get<5>(str.param);
|
||||
float beta = std::get<6>(str.param);
|
||||
std::string str_name = "bli_sdotxv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of sdotxv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -145,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::sdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<float>()
|
||||
);
|
||||
|
||||
// Test when conjugate of x is used as an argument.
|
||||
@@ -163,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::sdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<float>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -181,6 +154,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(1.0, 2.0), // alpha
|
||||
::testing::Values(2.0, 3.0) // beta
|
||||
),
|
||||
::sdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -73,3 +73,29 @@ static void test_dotxv( gtint_t n, char conjx, char conjy, T alpha,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "rho", rho, rho_ref, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class dotxvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,char,char,gtint_t,gtint_t,T,T>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
char conjy = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
T alpha = std::get<5>(str.param);
|
||||
T beta = std::get<6>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -105,33 +105,6 @@ TEST_P( zdotxvGenericTest, RandomData )
|
||||
test_dotxv<T>(n, conj_x, conj_y, alpha, incx, incy, beta, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zdotxvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<gtint_t,char,char,gtint_t,gtint_t,dcomplex,dcomplex>> str) const {
|
||||
gtint_t n = std::get<0>(str.param);
|
||||
char conjx = std::get<1>(str.param);
|
||||
char conjy = std::get<2>(str.param);
|
||||
gtint_t incx = std::get<3>(str.param);
|
||||
gtint_t incy = std::get<4>(str.param);
|
||||
dcomplex alpha = std::get<5>(str.param);
|
||||
dcomplex beta = std::get<6>(str.param);
|
||||
std::string str_name = "bli_zdotxv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conjx, 1);
|
||||
str_name += "_" + std::string(&conjy, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
str_name += "_beta_" + testinghelpers::get_value_string(beta);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of zdotxv.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -146,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{1.0, -1.0}), // alpha
|
||||
::testing::Values(dcomplex{-1.0, 1.0}) // beta
|
||||
),
|
||||
::zdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -164,6 +137,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(dcomplex{1.0, -1.0}), // alpha
|
||||
::testing::Values(dcomplex{-1.0, 1.0}) // beta
|
||||
),
|
||||
::zdotxvGenericTestPrint()
|
||||
::dotxvGenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -82,28 +82,6 @@ TEST_P( cscal2vGenericTest, RandomData )
|
||||
test_scal2v<T>( conj_alpha, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class cscal2vGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, scomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
scomplex alpha = std::get<4>(str.param);
|
||||
std::string str_name = "bli_cscal2v";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of cscal2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -116,7 +94,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(scomplex{2.0, -1.0}, scomplex{-2.0, 3.0}) // alpha
|
||||
),
|
||||
::cscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
|
||||
@@ -133,6 +111,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(4)), // stride size for y
|
||||
::testing::Values(scomplex{4.0, 3.1}) // alpha
|
||||
),
|
||||
::cscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -81,28 +81,6 @@ TEST_P( dscal2vGenericTest, RandomData )
|
||||
test_scal2v<T>( conj_alpha, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class dscal2vGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, double>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
double alpha = std::get<4>(str.param);
|
||||
std::string str_name = "bli_dscal2v";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of dscal2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -115,7 +93,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(double(2.0), double(-3.0)) // alpha
|
||||
),
|
||||
::dscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<double>()
|
||||
);
|
||||
|
||||
// Test when conjugate of x is used as an argument. This option is BLIS-api specific.
|
||||
@@ -131,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(double(-3.0)) // alpha
|
||||
),
|
||||
::dscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<double>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -147,6 +125,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(5)), // stride size for y
|
||||
::testing::Values(double(3.0)) // alpha
|
||||
),
|
||||
::dscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -81,29 +81,6 @@ TEST_P( sscal2vGenericTest, RandomData )
|
||||
test_scal2v<T>( conj_alpha, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class sscal2vGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, float>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
float alpha = std::get<4>(str.param);
|
||||
std::string str_name = "bli_sscal2v";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of sscal2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -116,7 +93,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(float(3.0), float(-5.0)) // alpha
|
||||
),
|
||||
::sscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<float>()
|
||||
);
|
||||
|
||||
// Test when conjugate of x is used as an argument. This option is BLIS-api specific.
|
||||
@@ -132,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(float(9.0)) // alpha
|
||||
),
|
||||
::sscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<float>()
|
||||
);
|
||||
|
||||
// Test for non-unit increments.
|
||||
@@ -148,6 +125,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(7)), // stride size for y
|
||||
::testing::Values(float(2.0)) // alpha
|
||||
),
|
||||
::sscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -68,3 +68,25 @@ static void test_scal2v(char conjx, gtint_t n, gtint_t incx, gtint_t incy, T alp
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class scal2vGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, T>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
T alpha = std::get<4>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -83,28 +83,6 @@ TEST_P( zscal2vGenericTest, RandomData )
|
||||
test_scal2v<T>( conj_alpha, n, incx, incy, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zscal2vGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, dcomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
dcomplex alpha = std::get<4>(str.param);
|
||||
std::string str_name = "bli_zscal2v";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing for generic and main use of cscal2.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -117,7 +95,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for y
|
||||
::testing::Values(dcomplex{3.0, -2.0}, dcomplex{-1.0, 4.0}) // alpha
|
||||
),
|
||||
::zscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
|
||||
@@ -134,6 +112,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(3)), // stride size for y
|
||||
::testing::Values(dcomplex{1.0, 2.1}) // alpha
|
||||
),
|
||||
::zscal2vGenericTestPrint()
|
||||
::scal2vGenericPrint<dcomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -78,33 +78,6 @@ TEST_P( cscalvGenericTest, RandomData )
|
||||
test_scalv<T>( conj_alpha, n, incx, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class cscalvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, scomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
scomplex alpha = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "cscal_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_cscal";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_cscalv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of cscal.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -119,7 +92,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(scomplex{2.0, -1.0}, scomplex{-2.0, 3.0}) // alpha
|
||||
),
|
||||
::cscalvGenericTestPrint()
|
||||
::scalvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
|
||||
@@ -139,7 +112,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), //(gtint_t(-5), gtint_t(-17)) // stride size for x
|
||||
::testing::Values(scomplex{4.0, 3.1}) // alpha
|
||||
),
|
||||
::cscalvGenericTestPrint()
|
||||
::scalvGenericPrint<scomplex>()
|
||||
);
|
||||
|
||||
#ifndef TEST_BLIS_TYPED
|
||||
@@ -155,6 +128,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-2), gtint_t(-1)), // stride size for x
|
||||
::testing::Values(scomplex{4.0, 3.1}) // alpha
|
||||
),
|
||||
::cscalvGenericTestPrint()
|
||||
::scalvGenericPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -80,37 +80,6 @@ TEST_P( dscalv_EVT, ExceptionData )
|
||||
test_scalv<T>( conj_alpha, n, incx, xi, x_exval, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class dscalv_EVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, double, double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t xi = std::get<3>(str.param);
|
||||
double x_exval = std::get<4>(str.param);
|
||||
double alpha = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "dscal_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_dscal";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_dscalv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -173,7 +142,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
// Tests for Zen3 Architecture.
|
||||
@@ -247,7 +216,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
// EVT with non-unit stride vector containing Infs/NaNs.
|
||||
@@ -285,7 +254,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -315,7 +284,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -341,7 +310,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a non-unit stride vector.
|
||||
@@ -367,5 +336,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::dscalv_EVTPrint()
|
||||
(::scalvEVTPrint<double, double>())
|
||||
);
|
||||
|
||||
@@ -77,33 +77,6 @@ TEST_P( dscalvGenericTest, RandomData )
|
||||
test_scalv<T>( conj_alpha, n, incx, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class dscalvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
double alpha = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "dscal_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_dscal";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_dscalv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic use of dscal.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
unitPositiveIncrement,
|
||||
@@ -124,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double(-3.0)
|
||||
)
|
||||
),
|
||||
::dscalvGenericTestPrint()
|
||||
::scalvGenericPrint<double>()
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -147,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double(-3.0)
|
||||
)
|
||||
),
|
||||
::dscalvGenericTestPrint()
|
||||
::scalvGenericPrint<double>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -163,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(double(-3.0)) // alpha
|
||||
),
|
||||
::dscalvGenericTestPrint()
|
||||
::scalvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -194,6 +167,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.0)
|
||||
)
|
||||
),
|
||||
::dscalvGenericTestPrint()
|
||||
::scalvGenericPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -77,33 +77,6 @@ TEST_P( sscalvGenericTest, RandomData )
|
||||
test_scalv<T>( conj_alpha, n, incx, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class sscalvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, float>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
float alpha = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "sscal_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_sscal";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_sscalv";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for generic and main use of sscal.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Blackbox,
|
||||
@@ -114,7 +87,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(float(3.0), float(-5.0)) // alpha
|
||||
),
|
||||
::sscalvGenericTestPrint()
|
||||
::scalvGenericPrint<float>()
|
||||
);
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
@@ -130,7 +103,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(1)), // stride size for x
|
||||
::testing::Values(float(9.0)) // alpha
|
||||
),
|
||||
::sscalvGenericTestPrint()
|
||||
::scalvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -146,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(2), gtint_t(11)), //(gtint_t(-5), gtint_t(-17)) // stride size for x
|
||||
::testing::Values(float(2.0)) // alpha
|
||||
),
|
||||
::sscalvGenericTestPrint()
|
||||
::scalvGenericPrint<float>()
|
||||
);
|
||||
|
||||
|
||||
@@ -163,6 +136,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(gtint_t(-2), gtint_t(-1)), // stride size for x
|
||||
::testing::Values(3) // alpha
|
||||
),
|
||||
::sscalvGenericTestPrint()
|
||||
::scalvGenericPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -100,3 +100,47 @@ static void test_scalv( char conja_alpha, gtint_t n, gtint_t incx, gtint_t xi,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "x", n, x.data(), x_ref.data(), incx, thresh, true );
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
template <typename T>
|
||||
class scalvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, T>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
T alpha = std::get<3>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename U>
|
||||
class scalvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, T, U>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t xi = std::get<3>(str.param);
|
||||
T x_exval = std::get<4>(str.param);
|
||||
U alpha = std::get<5>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conjx == 'n') ? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -85,38 +85,6 @@ TEST_P( zdscalvEVT, NaNInfCheck )
|
||||
test_scalv<T, RT>( conj_alpha, n, incx, xi, x_exval, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zdscalvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, dcomplex, double >> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t xi = std::get<3>(str.param);
|
||||
dcomplex x_exval = std::get<4>(str.param);
|
||||
double alpha = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conj == 'n') ? "_noconj" : "_conj";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -210,7 +178,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
// Tests for Zen4 Architecture.
|
||||
@@ -275,7 +243,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
// EVT with non-unit stride vector containing Infs/NaNs.
|
||||
@@ -315,7 +283,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
double( 7.3)
|
||||
)
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -342,7 +310,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -367,7 +335,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -392,5 +360,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// alpha: value of scalar.
|
||||
::testing::Values( NaN, Inf, -Inf )
|
||||
),
|
||||
::zdscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, double>())
|
||||
);
|
||||
|
||||
@@ -84,38 +84,6 @@ TEST_P( zscalvEVT, NaNInfCheck )
|
||||
test_scalv<T>( conj_alpha, n, incx, xi, x_exval, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zscalvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, dcomplex, dcomplex>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t xi = std::get<3>(str.param);
|
||||
dcomplex x_exval = std::get<4>(str.param);
|
||||
dcomplex alpha = std::get<5>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "blis_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conj == 'n') ? "_noconj" : "_conj";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + testinghelpers::get_value_string(x_exval);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
static double Inf = std::numeric_limits<double>::infinity();
|
||||
|
||||
@@ -167,7 +135,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{ 7.3, 5.1}
|
||||
)
|
||||
),
|
||||
::zscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, dcomplex>())
|
||||
);
|
||||
|
||||
// EVT with non-unit stride vector containing Infs/NaNs.
|
||||
@@ -206,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{ 7.3, 5.1}
|
||||
)
|
||||
),
|
||||
::zscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, dcomplex>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -240,7 +208,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-Inf, -Inf}
|
||||
)
|
||||
),
|
||||
::zscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, dcomplex>())
|
||||
);
|
||||
|
||||
// EVT with alpha containing Infs/NaNs on a unit stride vector.
|
||||
@@ -274,5 +242,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{-Inf, -Inf}
|
||||
)
|
||||
),
|
||||
::zscalvEVTPrint()
|
||||
(::scalvEVTPrint<dcomplex, dcomplex>())
|
||||
);
|
||||
|
||||
@@ -78,33 +78,6 @@ TEST_P( zscalvGenericTest, RandomData )
|
||||
test_scalv<T>( conj_alpha, n, incx, alpha, thresh );
|
||||
}
|
||||
|
||||
// Used to generate a test case with a sensible name.
|
||||
// Beware that we cannot use fp numbers (e.g., 2.3) in the names,
|
||||
// so we are only printing int(2.3). This should be enough for debugging purposes.
|
||||
// If this poses an issue, please reach out.
|
||||
class zscalvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, dcomplex>> str) const {
|
||||
char conj_alpha = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
dcomplex alpha = std::get<3>(str.param);
|
||||
#ifdef TEST_BLAS
|
||||
std::string str_name = "blas_";
|
||||
#elif TEST_CBLAS
|
||||
std::string str_name = "cblas_";
|
||||
#else //#elif TEST_BLIS_TYPED
|
||||
std::string str_name = "bli_";
|
||||
#endif
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += (conj_alpha == 'n') ? "_noconjalpha" : "_conjalpha";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_alpha_" + testinghelpers::get_value_string(alpha);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
// Black box testing for zscal.
|
||||
// Tests with unit-positive increment.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -129,7 +102,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{ 7.3, 5.1}
|
||||
)
|
||||
),
|
||||
::zscalvGenericTestPrint()
|
||||
::scalvGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
|
||||
@@ -159,5 +132,5 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
dcomplex{ 7.3, 5.1}
|
||||
)
|
||||
),
|
||||
::zscalvGenericTestPrint()
|
||||
::scalvGenericPrint<dcomplex>()
|
||||
);
|
||||
|
||||
@@ -61,22 +61,6 @@ TEST_P( csetvGenericTest, RandomData )
|
||||
test_setv<T>( conjalpha, n, alpha, incx );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class csetvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
std::string str_name = "bli_csetv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -87,6 +71,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(10), gtint_t(101), 10), // m size of vector takes values from 10 to 100 with step size of 10.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::csetvGenericTestPrint()
|
||||
::setvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -61,22 +61,6 @@ TEST_P( dsetvGenericTest, RandomData )
|
||||
test_setv<T>( conjalpha, n, alpha, incx );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class dsetvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
std::string str_name = "bli_dsetv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -87,6 +71,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(10), gtint_t(101), 10), // m size of vector takes values from 10 to 100 with step size of 10.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::dsetvGenericTestPrint()
|
||||
::setvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -61,22 +61,6 @@ TEST_P( ssetvGenericTest, RandomData )
|
||||
test_setv<T>( conjalpha, n, alpha, incx );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class ssetvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
std::string str_name = "bli_ssetv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -87,6 +71,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(10), gtint_t(101), 10), // m size of vector takes values from 10 to 100 with step size of 10.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::ssetvGenericTestPrint()
|
||||
::setvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -73,3 +73,21 @@ void test_setv( char conjalpha, gtint_t n, T alpha, gtint_t incx )
|
||||
EXPECT_EQ(x[i], alpha_ref) << "blis_sol[" << i << "]="<< x[i] <<" ref = " << alpha_ref;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
class setvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
@@ -61,22 +61,6 @@ TEST_P( zsetvGenericTest, RandomData )
|
||||
test_setv<T>( conjalpha, n, alpha, incx );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class zsetvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
std::string str_name = "bli_zsetv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
// Black box testing.
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
@@ -87,6 +71,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Range(gtint_t(10), gtint_t(101), 10), // m size of vector takes values from 10 to 100 with step size of 10.
|
||||
::testing::Values(gtint_t(1)) // stride size for x
|
||||
),
|
||||
::zsetvGenericTestPrint()
|
||||
::setvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,36 +89,6 @@ TEST_P( csubvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)
|
||||
class csubvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, scomplex, gtint_t, scomplex>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
scomplex xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
scomplex yexval = std::get<7>(str.param);
|
||||
std::string str_name = "bli_";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
|
||||
static float NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -157,7 +127,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// value on y
|
||||
::testing::Values(scomplex{0.0, 0.0})
|
||||
),
|
||||
::csubvEVTPrint()
|
||||
::subvEVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides
|
||||
@@ -193,7 +163,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{4.5, -Inf}, scomplex{NaN, Inf},
|
||||
scomplex{NaN, -Inf})
|
||||
),
|
||||
::csubvEVTPrint()
|
||||
::subvEVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides
|
||||
@@ -234,7 +204,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{4.5, -Inf}, scomplex{NaN, Inf},
|
||||
scomplex{NaN, -Inf})
|
||||
),
|
||||
::csubvEVTPrint()
|
||||
::subvEVTPrint<scomplex>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X & Y vectors) with non-unit strides.
|
||||
@@ -272,6 +242,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
scomplex{4.5, -Inf}, scomplex{NaN, Inf},
|
||||
scomplex{0.0, 0.0}, scomplex{NaN, -Inf})
|
||||
),
|
||||
::csubvEVTPrint()
|
||||
::subvEVTPrint<scomplex>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -74,24 +74,6 @@ TEST_P( csubvGenericTest, FunctionalTest )
|
||||
test_subv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class csubvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_csubv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_conj_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
PositiveIncrements,
|
||||
@@ -125,6 +107,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1),gtint_t(5)
|
||||
)
|
||||
),
|
||||
::csubvGenericTestPrint()
|
||||
::subvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,36 +89,6 @@ TEST_P( dsubvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)
|
||||
class dsubvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, double, gtint_t, double>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
double xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
double yexval = std::get<7>(str.param);
|
||||
std::string str_name = "bli_";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
|
||||
static double NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -154,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// value on y
|
||||
::testing::Values(double(0.0))
|
||||
),
|
||||
::dsubvEVTPrint()
|
||||
::subvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides on zen3
|
||||
@@ -187,7 +157,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf)
|
||||
),
|
||||
::dsubvEVTPrint()
|
||||
::subvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides on zen3
|
||||
@@ -222,7 +192,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf)
|
||||
),
|
||||
::dsubvEVTPrint()
|
||||
::subvEVTPrint<double>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X & Y vectors) with non-unit strides.
|
||||
@@ -254,6 +224,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf, 0.0)
|
||||
),
|
||||
::dsubvEVTPrint()
|
||||
::subvEVTPrint<double>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -73,24 +73,6 @@ TEST_P( dsubvGenericTest, FunctionalTest )
|
||||
test_subv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class dsubvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_dsubv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_conj_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
PositiveIncrements,
|
||||
@@ -124,7 +106,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1),gtint_t(5)
|
||||
)
|
||||
),
|
||||
::dsubvGenericTestPrint()
|
||||
::subvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -150,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1),gtint_t(5)
|
||||
)
|
||||
),
|
||||
::dsubvGenericTestPrint()
|
||||
::subvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -89,36 +89,6 @@ TEST_P( ssubvEVT, NaNInfCheck )
|
||||
yj, yexval, thresh );
|
||||
}
|
||||
|
||||
// Test-case logger : Used to print the test-case details when vectors have exception value.
|
||||
// The string format is as follows :
|
||||
// n(vec_size)_(conjx/noconjx)_incx(m)(abs_incx)_incy(m)(abs_incy)_X_(xi)_(xexval)_(yi)_(yexval)
|
||||
class ssubvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, float, gtint_t, float>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
float xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
float yexval = std::get<7>(str.param);
|
||||
std::string str_name = "bli_";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
|
||||
static float NaN = std::numeric_limits<double>::quiet_NaN();
|
||||
@@ -154,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// value on y
|
||||
::testing::Values(float(0.0))
|
||||
),
|
||||
::ssubvEVTPrint()
|
||||
::subvEVTPrint<float>()
|
||||
);
|
||||
|
||||
// Exception value testing(on Y vector alone) with unit strides on zen3
|
||||
@@ -187,7 +157,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf)
|
||||
),
|
||||
::ssubvEVTPrint()
|
||||
::subvEVTPrint<float>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X and Y vectors) with unit strides on zen3
|
||||
@@ -222,7 +192,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf)
|
||||
),
|
||||
::ssubvEVTPrint()
|
||||
::subvEVTPrint<float>()
|
||||
);
|
||||
|
||||
// Exception value testing(on X & Y vectors) with non-unit stridesi.
|
||||
@@ -254,6 +224,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
// exception values to set on y
|
||||
::testing::Values(NaN, -Inf, Inf, 0.0)
|
||||
),
|
||||
::ssubvEVTPrint()
|
||||
::subvEVTPrint<float>()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -73,24 +73,6 @@ TEST_P( ssubvGenericTest, FunctionalTest )
|
||||
test_subv<T>( conj_x, n, incx, incy, thresh );
|
||||
}
|
||||
|
||||
// Prints the test case combination
|
||||
class ssubvGenericTestPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
std::string str_name = "bli_ssubv";
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_conj_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef TEST_BLIS_TYPED
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
PositiveIncrements,
|
||||
@@ -124,7 +106,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1),gtint_t(5)
|
||||
)
|
||||
),
|
||||
::ssubvGenericTestPrint()
|
||||
::subvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -150,6 +132,6 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
gtint_t(1),gtint_t(5)
|
||||
)
|
||||
),
|
||||
::ssubvGenericTestPrint()
|
||||
::subvGenericPrint()
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -100,3 +100,52 @@ static void test_subv( char conjx, gtint_t n, gtint_t incx, gtint_t incy,
|
||||
//----------------------------------------------------------
|
||||
computediff<T>( "y", n, y.data(), y_ref.data(), incy, thresh, true );
|
||||
}
|
||||
|
||||
|
||||
// Test-case logger : Used to print the test-case details based on parameters
|
||||
class subvGenericPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char,gtint_t,gtint_t,gtint_t>> str) const {
|
||||
char conj = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += "_conj_" + std::string(&conj, 1);
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class subvEVTPrint {
|
||||
public:
|
||||
std::string operator()(
|
||||
testing::TestParamInfo<std::tuple<char, gtint_t, gtint_t, gtint_t, gtint_t, T, gtint_t, T>> str) const {
|
||||
char conjx = std::get<0>(str.param);
|
||||
gtint_t n = std::get<1>(str.param);
|
||||
gtint_t incx = std::get<2>(str.param);
|
||||
gtint_t incy = std::get<3>(str.param);
|
||||
gtint_t xi = std::get<4>(str.param);
|
||||
T xexval = std::get<5>(str.param);
|
||||
gtint_t yj = std::get<6>(str.param);
|
||||
T yexval = std::get<7>(str.param);
|
||||
|
||||
std::string str_name = API_PRINT;
|
||||
str_name += "_n_" + std::to_string(n);
|
||||
str_name += ( conjx == 'n' )? "_noconjx" : "_conjx";
|
||||
str_name += "_incx_" + testinghelpers::get_value_string(incx);
|
||||
str_name += "_incy_" + testinghelpers::get_value_string(incy);
|
||||
std::string xexval_str = testinghelpers::get_value_string(xexval);
|
||||
std::string yexval_str = testinghelpers::get_value_string(yexval);
|
||||
str_name = str_name + "_X_" + std::to_string(xi);
|
||||
str_name = str_name + "_" + xexval_str;
|
||||
str_name = str_name + "_Y_" + std::to_string(yj);
|
||||
str_name = str_name + "_" + yexval_str;
|
||||
return str_name;
|
||||
}
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user