From edbbbe8791885ece5ce097ab38828c70ba3aea7d Mon Sep 17 00:00:00 2001 From: Eleni Vlachopoulou Date: Fri, 26 Apr 2024 11:12:07 +0100 Subject: [PATCH] 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 --- gtestsuite/testsuite/CMakeLists.txt | 6 +- .../extension/imatcopy/cimatcopy_evt.cpp | 44 +----- .../extension/imatcopy/cimatcopy_generic.cpp | 43 +----- .../extension/imatcopy/dimatcopy_evt.cpp | 44 +----- .../extension/imatcopy/dimatcopy_generic.cpp | 43 +----- .../extension/imatcopy/simatcopy_evt.cpp | 44 +----- .../extension/imatcopy/simatcopy_generic.cpp | 45 +----- .../extension/imatcopy/test_imatcopy.h | 62 ++++++++ .../extension/imatcopy/zimatcopy_evt.cpp | 44 +----- .../extension/imatcopy/zimatcopy_generic.cpp | 43 +----- .../extension/omatcopy/comatcopy_evt.cpp | 44 +----- .../extension/omatcopy/comatcopy_generic.cpp | 42 +----- .../extension/omatcopy/domatcopy_evt.cpp | 44 +----- .../extension/omatcopy/domatcopy_generic.cpp | 42 +----- .../extension/omatcopy/somatcopy_evt.cpp | 44 +----- .../extension/omatcopy/somatcopy_generic.cpp | 42 +----- .../extension/omatcopy/test_omatcopy.h | 60 ++++++++ .../extension/omatcopy/zomatcopy_evt.cpp | 44 +----- .../extension/omatcopy/zomatcopy_generic.cpp | 42 +----- .../extension/omatcopy2/comatcopy2_evt.cpp | 48 +----- .../omatcopy2/comatcopy2_generic.cpp | 46 +----- .../extension/omatcopy2/domatcopy2_evt.cpp | 48 +----- .../omatcopy2/domatcopy2_generic.cpp | 46 +----- .../extension/omatcopy2/somatcopy2_evt.cpp | 48 +----- .../omatcopy2/somatcopy2_generic.cpp | 46 +----- .../extension/omatcopy2/test_omatcopy2.h | 69 +++++++++ .../extension/omatcopy2/zomatcopy2_evt.cpp | 48 +----- .../omatcopy2/zomatcopy2_generic.cpp | 46 +----- .../testsuite/level1/addv/caddv_generic.cpp | 20 +-- .../testsuite/level1/addv/daddv_generic.cpp | 20 +-- .../testsuite/level1/addv/saddv_generic.cpp | 20 +-- gtestsuite/testsuite/level1/addv/test_addv.h | 19 +++ .../testsuite/level1/addv/zaddv_generic.cpp | 20 +-- .../testsuite/level1/amaxv/camaxv_generic.cpp | 32 +--- .../level1/amaxv/damaxv_evt_testing.cpp | 34 +---- .../testsuite/level1/amaxv/damaxv_generic.cpp | 32 +--- .../level1/amaxv/samaxv_evt_testing.cpp | 34 +---- .../testsuite/level1/amaxv/samaxv_generic.cpp | 32 +--- .../testsuite/level1/amaxv/test_amaxv.h | 36 +++++ .../testsuite/level1/amaxv/zamaxv_generic.cpp | 32 +--- .../level1/axpbyv/caxpbyv_generic.cpp | 37 +---- .../level1/axpbyv/daxpbyv_evt_testing.cpp | 86 +---------- .../level1/axpbyv/daxpbyv_generic.cpp | 39 +---- .../level1/axpbyv/saxpbyv_generic.cpp | 39 +---- .../testsuite/level1/axpbyv/test_axpbyv.h | 59 ++++++++ .../level1/axpbyv/zaxpbyv_evt_testing.cpp | 86 +---------- .../level1/axpbyv/zaxpbyv_generic.cpp | 41 +---- .../testsuite/level1/axpyf/daxpyf_generic.cpp | 35 +---- .../testsuite/level1/axpyf/test_axpyf.h | 35 +++++ .../testsuite/level1/axpyv/caxpyv_generic.cpp | 35 +---- .../level1/axpyv/daxpyv_evt_testing.cpp | 90 ++--------- .../testsuite/level1/axpyv/daxpyv_generic.cpp | 40 +---- .../level1/axpyv/saxpyv_evt_testing.cpp | 90 ++--------- .../testsuite/level1/axpyv/saxpyv_generic.cpp | 36 +---- .../testsuite/level1/axpyv/test_axpyv.h | 55 +++++++ .../level1/axpyv/zaxpyv_evt_testing.cpp | 82 +--------- .../testsuite/level1/axpyv/zaxpyv_generic.cpp | 34 +---- .../testsuite/level1/copyv/ccopyv_generic.cpp | 33 +--- .../testsuite/level1/copyv/dcopyv_generic.cpp | 35 +---- .../testsuite/level1/copyv/scopyv_generic.cpp | 35 +---- .../testsuite/level1/copyv/test_copyv.h | 19 +++ .../testsuite/level1/copyv/zcopyv_generic.cpp | 33 +--- .../testsuite/level1/dotv/cdotv_generic.cpp | 35 +---- .../level1/dotv/ddotv_evt_testing.cpp | 54 +------ .../testsuite/level1/dotv/ddotv_generic.cpp | 39 +---- .../testsuite/level1/dotv/sdotv_generic.cpp | 37 +---- gtestsuite/testsuite/level1/dotv/test_dotv.h | 52 +++++++ .../testsuite/level1/dotv/zdotv_generic.cpp | 35 +---- .../testsuite/level1/dotxf/ddotxf_generic.cpp | 39 +---- .../testsuite/level1/dotxf/test_dotxf.h | 39 +++++ .../testsuite/level1/dotxv/cdotxv_generic.cpp | 33 +--- .../testsuite/level1/dotxv/ddotxv_generic.cpp | 33 +--- .../testsuite/level1/dotxv/sdotxv_generic.cpp | 33 +--- .../testsuite/level1/dotxv/test_dotxv.h | 26 ++++ .../testsuite/level1/dotxv/zdotxv_generic.cpp | 31 +--- .../level1/scal2v/cscal2v_generic.cpp | 26 +--- .../level1/scal2v/dscal2v_generic.cpp | 28 +--- .../level1/scal2v/sscal2v_generic.cpp | 29 +--- .../testsuite/level1/scal2v/test_scal2v.h | 22 +++ .../level1/scal2v/zscal2v_generic.cpp | 26 +--- .../testsuite/level1/scalv/cscalv_generic.cpp | 33 +--- .../level1/scalv/dscalv_evt_testing.cpp | 43 +----- .../testsuite/level1/scalv/dscalv_generic.cpp | 35 +---- .../testsuite/level1/scalv/sscalv_generic.cpp | 35 +---- .../testsuite/level1/scalv/test_scalv.h | 44 ++++++ .../level1/scalv/zdscalv_evt_testing.cpp | 44 +----- .../level1/scalv/zscalv_evt_testing.cpp | 40 +---- .../testsuite/level1/scalv/zscalv_generic.cpp | 31 +--- .../testsuite/level1/setv/csetv_generic.cpp | 18 +-- .../testsuite/level1/setv/dsetv_generic.cpp | 18 +-- .../testsuite/level1/setv/ssetv_generic.cpp | 18 +-- gtestsuite/testsuite/level1/setv/test_setv.h | 18 +++ .../testsuite/level1/setv/zsetv_generic.cpp | 18 +-- .../level1/subv/csubv_evt_testing.cpp | 38 +---- .../testsuite/level1/subv/csubv_generic.cpp | 20 +-- .../level1/subv/dsubv_evt_testing.cpp | 38 +---- .../testsuite/level1/subv/dsubv_generic.cpp | 22 +-- .../level1/subv/ssubv_evt_testing.cpp | 38 +---- .../testsuite/level1/subv/ssubv_generic.cpp | 22 +-- gtestsuite/testsuite/level1/subv/test_subv.h | 49 ++++++ .../level1/subv/zsubv_evt_testing.cpp | 38 +---- .../testsuite/level1/subv/zsubv_generic.cpp | 20 +-- .../testsuite/level1/swapv/cswapv_generic.cpp | 20 +-- .../testsuite/level1/swapv/dswapv_generic.cpp | 20 +-- .../testsuite/level1/swapv/sswapv_generic.cpp | 20 +-- .../testsuite/level1/swapv/test_swapv.h | 17 +++ .../testsuite/level1/swapv/zswapv_generic.cpp | 20 +-- .../testsuite/level1/xpbyv/cxpbyv_generic.cpp | 27 +--- .../testsuite/level1/xpbyv/dxpbyv_generic.cpp | 29 +--- .../testsuite/level1/xpbyv/sxpbyv_generic.cpp | 29 +--- .../testsuite/level1/xpbyv/test_xpbyv.h | 21 +++ .../testsuite/level1/xpbyv/zxpbyv_generic.cpp | 27 +--- .../level2/gemv/cgemv_evt_testing.cpp | 51 +------ .../testsuite/level2/gemv/cgemv_generic.cpp | 54 +------ .../level2/gemv/dgemv_evt_testing.cpp | 50 +------ .../testsuite/level2/gemv/dgemv_generic.cpp | 48 +----- .../level2/gemv/sgemv_evt_testing.cpp | 51 +------ .../testsuite/level2/gemv/sgemv_generic.cpp | 47 +----- gtestsuite/testsuite/level2/gemv/test_gemv.h | 72 +++++++++ .../level2/gemv/zgemv_evt_testing.cpp | 51 +------ .../testsuite/level2/gemv/zgemv_generic.cpp | 48 +----- gtestsuite/testsuite/level2/ger/cger_evt.cpp | 55 +------ .../testsuite/level2/ger/cger_generic.cpp | 47 +----- gtestsuite/testsuite/level2/ger/dger_evt.cpp | 55 +------ .../testsuite/level2/ger/dger_generic.cpp | 47 +----- gtestsuite/testsuite/level2/ger/sger_evt.cpp | 55 +------ .../testsuite/level2/ger/sger_generic.cpp | 47 +----- gtestsuite/testsuite/level2/ger/test_ger.h | 82 ++++++++++ gtestsuite/testsuite/level2/ger/zger_evt.cpp | 55 +------ .../testsuite/level2/ger/zger_generic.cpp | 47 +----- .../testsuite/level2/hemv/chemv_generic.cpp | 35 +---- gtestsuite/testsuite/level2/hemv/test_hemv.h | 30 ++++ .../testsuite/level2/hemv/zhemv_generic.cpp | 35 +---- .../testsuite/level2/her/cher_generic.cpp | 30 +--- gtestsuite/testsuite/level2/her/test_her.h | 25 ++++ .../testsuite/level2/her/zher_generic.cpp | 30 +--- .../testsuite/level2/her2/cher2_generic.cpp | 33 +--- gtestsuite/testsuite/level2/her2/test_her2.h | 28 ++++ .../testsuite/level2/her2/zher2_generic.cpp | 33 +--- .../testsuite/level2/symv/dsymv_generic.cpp | 35 +---- .../testsuite/level2/symv/ssymv_generic.cpp | 35 +---- gtestsuite/testsuite/level2/symv/test_symv.h | 30 ++++ .../testsuite/level2/syr/dsyr_generic.cpp | 30 +--- .../testsuite/level2/syr/ssyr_generic.cpp | 30 +--- gtestsuite/testsuite/level2/syr/test_syr.h | 25 ++++ .../testsuite/level2/syr2/dsyr2_generic.cpp | 33 +--- .../testsuite/level2/syr2/ssyr2_generic.cpp | 33 +--- gtestsuite/testsuite/level2/syr2/test_syr2.h | 28 ++++ .../testsuite/level2/trmv/ctrmv_generic.cpp | 32 +--- .../testsuite/level2/trmv/dtrmv_generic.cpp | 32 +--- .../testsuite/level2/trmv/strmv_generic.cpp | 32 +--- gtestsuite/testsuite/level2/trmv/test_trmv.h | 27 ++++ .../testsuite/level2/trmv/ztrmv_generic.cpp | 32 +--- .../testsuite/level2/trsv/ctrsv_generic.cpp | 32 +--- .../level2/trsv/dtrsv_evt_testing.cpp | 40 +---- .../testsuite/level2/trsv/dtrsv_generic.cpp | 37 +---- .../testsuite/level2/trsv/strsv_generic.cpp | 32 +--- gtestsuite/testsuite/level2/trsv/test_trsv.h | 93 ++++++++++++ .../level2/trsv/ztrsv_evt_testing.cpp | 40 +---- .../testsuite/level2/trsv/ztrsv_generic.cpp | 2 +- .../level3/gemm/cgemm_evt_testing.cpp | 79 ++-------- .../testsuite/level3/gemm/cgemm_generic.cpp | 50 +------ .../level3/gemm/dgemm_evt_testing.cpp | 83 +---------- .../testsuite/level3/gemm/dgemm_generic.cpp | 46 +----- .../testsuite/level3/gemm/dgemm_ovr_undr.cpp | 69 +-------- .../level3/gemm/sgemm_evt_testing.cpp | 70 +-------- .../testsuite/level3/gemm/sgemm_generic.cpp | 47 +----- gtestsuite/testsuite/level3/gemm/test_gemm.h | 141 ++++++++++++++++++ .../level3/gemm/zgemm_evt_testing.cpp | 79 +--------- .../testsuite/level3/gemm/zgemm_generic.cpp | 57 ++----- .../gemm_compute/dgemm_compute_generic.cpp | 46 +----- .../gemm_compute/sgemm_compute_generic.cpp | 46 +----- .../level3/gemm_compute/test_gemm_compute.h | 36 +++++ .../testsuite/level3/gemmt/cgemmt_generic.cpp | 38 +---- .../level3/gemmt/dgemmt_evt_testing.cpp | 49 +----- .../testsuite/level3/gemmt/dgemmt_generic.cpp | 48 +----- .../testsuite/level3/gemmt/sgemmt_generic.cpp | 38 +---- .../testsuite/level3/gemmt/test_gemmt.h | 115 ++++++++++++++ .../testsuite/level3/gemmt/zgemmt_generic.cpp | 38 +---- .../testsuite/level3/hemm/chemm_generic.cpp | 39 +---- gtestsuite/testsuite/level3/hemm/test_hemm.h | 34 +++++ .../testsuite/level3/hemm/zhemm_generic.cpp | 39 +---- .../testsuite/level3/her2k/cher2k_generic.cpp | 38 +---- .../testsuite/level3/her2k/test_her2k.h | 33 ++++ .../testsuite/level3/her2k/zher2k_generic.cpp | 38 +---- .../testsuite/level3/herk/cherk_generic.cpp | 35 +---- gtestsuite/testsuite/level3/herk/test_herk.h | 30 ++++ .../testsuite/level3/herk/zherk_generic.cpp | 35 +---- .../testsuite/level3/symm/csymm_generic.cpp | 39 +---- .../testsuite/level3/symm/dsymm_generic.cpp | 39 +---- .../testsuite/level3/symm/ssymm_generic.cpp | 39 +---- gtestsuite/testsuite/level3/symm/test_symm.h | 34 +++++ .../testsuite/level3/symm/zsymm_generic.cpp | 39 +---- .../testsuite/level3/syr2k/csyr2k_generic.cpp | 38 +---- .../testsuite/level3/syr2k/dsyr2k_generic.cpp | 38 +---- .../testsuite/level3/syr2k/ssyr2k_generic.cpp | 38 +---- .../testsuite/level3/syr2k/test_syr2k.h | 33 ++++ .../testsuite/level3/syr2k/zsyr2k_generic.cpp | 38 +---- .../testsuite/level3/syrk/csyrk_generic.cpp | 35 +---- .../testsuite/level3/syrk/dsyrk_generic.cpp | 35 +---- .../testsuite/level3/syrk/ssyrk_generic.cpp | 35 +---- gtestsuite/testsuite/level3/syrk/test_syrk.h | 30 ++++ .../testsuite/level3/syrk/zsyrk_generic.cpp | 35 +---- .../testsuite/level3/trmm/ctrmm_generic.cpp | 35 +---- .../testsuite/level3/trmm/dtrmm_generic.cpp | 35 +---- .../testsuite/level3/trmm/strmm_generic.cpp | 35 +---- gtestsuite/testsuite/level3/trmm/test_trmm.h | 30 ++++ .../testsuite/level3/trmm/ztrmm_generic.cpp | 35 +---- .../testsuite/level3/trmm3/ctrmm3_generic.cpp | 34 +---- .../testsuite/level3/trmm3/dtrmm3_generic.cpp | 34 +---- .../testsuite/level3/trmm3/strmm3_generic.cpp | 36 +---- .../testsuite/level3/trmm3/test_trmm3.h | 35 +++++ .../testsuite/level3/trmm3/ztrmm3_generic.cpp | 34 +---- .../level3/trsm/ctrsm_evt_testing.cpp | 47 +----- .../testsuite/level3/trsm/ctrsm_generic.cpp | 47 +----- .../level3/trsm/dtrsm_evt_testing.cpp | 39 +---- .../testsuite/level3/trsm/dtrsm_generic.cpp | 45 +----- .../level3/trsm/strsm_evt_testing.cpp | 47 +----- .../testsuite/level3/trsm/strsm_generic.cpp | 48 +----- gtestsuite/testsuite/level3/trsm/test_trsm.h | 75 ++++++++++ .../level3/trsm/ztrsm_evt_testing.cpp | 47 +----- .../testsuite/level3/trsm/ztrsm_generic.cpp | 47 +----- gtestsuite/testsuite/ukr/amaxv/damaxv_ukr.cpp | 26 +--- gtestsuite/testsuite/ukr/amaxv/samaxv_ukr.cpp | 26 +--- .../testsuite/ukr/amaxv/test_amaxv_ukr.h | 19 +++ .../testsuite/ukr/axpbyv/daxpbyv_ukr.cpp | 35 +---- .../testsuite/ukr/axpbyv/saxpbyv_ukr.cpp | 29 +--- .../testsuite/ukr/axpbyv/test_axpbyv_ukr.h | 50 +++++++ .../testsuite/ukr/axpbyv/zaxpbyv_ukr.cpp | 30 +--- gtestsuite/testsuite/ukr/axpyv/daxpyv_ukr.cpp | 37 +---- gtestsuite/testsuite/ukr/axpyv/saxpyv_ukr.cpp | 36 +---- .../testsuite/ukr/axpyv/test_axpyv_ukr.h | 25 ++++ gtestsuite/testsuite/ukr/axpyv/zaxpyv_ukr.cpp | 28 +--- gtestsuite/testsuite/ukr/copyv/dcopyv_ukr.cpp | 30 +--- .../testsuite/ukr/copyv/test_copyv_ukr.h | 21 +++ gtestsuite/testsuite/ukr/dotv/ddotv_ukr.cpp | 40 +---- gtestsuite/testsuite/ukr/dotv/test_dotv_ukr.h | 25 ++++ gtestsuite/testsuite/ukr/nrm2/dnrm2_ukr.cpp | 20 +-- gtestsuite/testsuite/ukr/nrm2/dznrm2_ukr.cpp | 20 +-- gtestsuite/testsuite/ukr/nrm2/scnrm2_ukr.cpp | 20 +-- gtestsuite/testsuite/ukr/nrm2/snrm2_ukr.cpp | 20 +-- gtestsuite/testsuite/ukr/nrm2/test_nrm2_ukr.h | 17 +++ gtestsuite/testsuite/ukr/scalv/dscalv_ukr.cpp | 35 +---- .../testsuite/ukr/scalv/test_scalv_ukr.h | 23 +++ .../testsuite/ukr/scalv/zdscalv_ukr.cpp | 34 +---- gtestsuite/testsuite/ukr/scalv/zscalv_ukr.cpp | 27 +--- gtestsuite/testsuite/ukr/swapv/dswapv_ukr.cpp | 29 +--- gtestsuite/testsuite/ukr/swapv/sswapv_ukr.cpp | 29 +--- .../testsuite/ukr/swapv/test_swapv_ukr.h | 20 +++ gtestsuite/testsuite/ukr/trsm/ctrsm_ukr.cpp | 35 +---- gtestsuite/testsuite/ukr/trsm/dtrsm_ukr.cpp | 65 +------- gtestsuite/testsuite/ukr/trsm/strsm_ukr.cpp | 66 +------- gtestsuite/testsuite/ukr/trsm/test_trsm_ukr.h | 63 ++++++++ gtestsuite/testsuite/ukr/trsm/ztrsm_ukr.cpp | 69 +-------- .../util/asumv/dasumv_evt_testing.cpp | 32 +--- .../testsuite/util/asumv/dasumv_generic.cpp | 26 +--- .../testsuite/util/asumv/dzasumv_generic.cpp | 26 +--- .../testsuite/util/asumv/sasumv_generic.cpp | 26 +--- .../testsuite/util/asumv/scasumv_generic.cpp | 26 +--- gtestsuite/testsuite/util/asumv/test_asumv.h | 41 ++++- .../util/nrm2/dnrm2_extreme_values.cpp | 46 +----- .../testsuite/util/nrm2/dnrm2_generic.cpp | 26 +--- .../util/nrm2/dznrm2_extreme_values.cpp | 46 +----- .../testsuite/util/nrm2/dznrm2_generic.cpp | 26 +--- .../util/nrm2/scnrm2_extreme_values.cpp | 44 +----- .../testsuite/util/nrm2/scnrm2_generic.cpp | 22 +-- .../util/nrm2/snrm2_extreme_values.cpp | 44 +----- .../testsuite/util/nrm2/snrm2_generic.cpp | 22 +-- gtestsuite/testsuite/util/nrm2/test_nrm2.h | 46 ++++++ 269 files changed, 2734 insertions(+), 7790 deletions(-) diff --git a/gtestsuite/testsuite/CMakeLists.txt b/gtestsuite/testsuite/CMakeLists.txt index db0d58e49..690fea2f3 100644 --- a/gtestsuite/testsuite/CMakeLists.txt +++ b/gtestsuite/testsuite/CMakeLists.txt @@ -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) diff --git a/gtestsuite/testsuite/extension/imatcopy/cimatcopy_evt.cpp b/gtestsuite/testsuite/extension/imatcopy/cimatcopy_evt.cpp index 46d2e9955..9a935efaa 100644 --- a/gtestsuite/testsuite/extension/imatcopy/cimatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/cimatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( cimatcopyEVT, NanInfCheck ) test_imatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/cimatcopy_generic.cpp b/gtestsuite/testsuite/extension/imatcopy/cimatcopy_generic.cpp index 8e6a617d8..e8b48337e 100644 --- a/gtestsuite/testsuite/extension/imatcopy/cimatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/cimatcopy_generic.cpp @@ -83,47 +83,6 @@ TEST_P( cimatcopyAPI, FunctionalTest ) test_imatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/dimatcopy_evt.cpp b/gtestsuite/testsuite/extension/imatcopy/dimatcopy_evt.cpp index a5b30f68b..984c47007 100644 --- a/gtestsuite/testsuite/extension/imatcopy/dimatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/dimatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( dimatcopyEVT, NanInfCheck ) test_imatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/dimatcopy_generic.cpp b/gtestsuite/testsuite/extension/imatcopy/dimatcopy_generic.cpp index a781a92b5..8d04a8456 100644 --- a/gtestsuite/testsuite/extension/imatcopy/dimatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/dimatcopy_generic.cpp @@ -83,47 +83,6 @@ TEST_P( dimatcopyAPI, FunctionalTest ) test_imatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/simatcopy_evt.cpp b/gtestsuite/testsuite/extension/imatcopy/simatcopy_evt.cpp index 1d6f02443..fb23e5936 100644 --- a/gtestsuite/testsuite/extension/imatcopy/simatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/simatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( simatcopyEVT, NanInfCheck ) test_imatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/simatcopy_generic.cpp b/gtestsuite/testsuite/extension/imatcopy/simatcopy_generic.cpp index d54281875..6294347bf 100644 --- a/gtestsuite/testsuite/extension/imatcopy/simatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/simatcopy_generic.cpp @@ -83,47 +83,6 @@ TEST_P( simatcopyAPI, FunctionalTest ) test_imatcopy( 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> 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() ); -#endif +#endif \ No newline at end of file diff --git a/gtestsuite/testsuite/extension/imatcopy/test_imatcopy.h b/gtestsuite/testsuite/extension/imatcopy/test_imatcopy.h index 2fe9dea6a..5d3b9d457 100644 --- a/gtestsuite/testsuite/extension/imatcopy/test_imatcopy.h +++ b/gtestsuite/testsuite/extension/imatcopy/test_imatcopy.h @@ -139,3 +139,65 @@ static void test_imatcopy( char storage, char trans, gtint_t m, gtint_t n, T alp computediff( "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 +class imatcopyGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class imatcopyEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/extension/imatcopy/zimatcopy_evt.cpp b/gtestsuite/testsuite/extension/imatcopy/zimatcopy_evt.cpp index f5c416b2d..41f3d6233 100644 --- a/gtestsuite/testsuite/extension/imatcopy/zimatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/zimatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( zimatcopyEVT, NanInfCheck ) test_imatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/imatcopy/zimatcopy_generic.cpp b/gtestsuite/testsuite/extension/imatcopy/zimatcopy_generic.cpp index 8ff3a86db..b7388006e 100644 --- a/gtestsuite/testsuite/extension/imatcopy/zimatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/imatcopy/zimatcopy_generic.cpp @@ -83,47 +83,6 @@ TEST_P( zimatcopyAPI, FunctionalTest ) test_imatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/comatcopy_evt.cpp b/gtestsuite/testsuite/extension/omatcopy/comatcopy_evt.cpp index b2b86525f..547f8787c 100644 --- a/gtestsuite/testsuite/extension/omatcopy/comatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/comatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( comatcopyEVT, NanInfCheck ) test_omatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/comatcopy_generic.cpp b/gtestsuite/testsuite/extension/omatcopy/comatcopy_generic.cpp index 5c9bcffe5..19d963997 100644 --- a/gtestsuite/testsuite/extension/omatcopy/comatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/comatcopy_generic.cpp @@ -83,46 +83,6 @@ TEST_P( comatcopyAPI, FunctionalTest ) test_omatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/domatcopy_evt.cpp b/gtestsuite/testsuite/extension/omatcopy/domatcopy_evt.cpp index 66d5a0145..a06d56dd1 100644 --- a/gtestsuite/testsuite/extension/omatcopy/domatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/domatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( domatcopyEVT, NanInfCheck ) test_omatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/domatcopy_generic.cpp b/gtestsuite/testsuite/extension/omatcopy/domatcopy_generic.cpp index 1471e3c5d..ba84e50d0 100644 --- a/gtestsuite/testsuite/extension/omatcopy/domatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/domatcopy_generic.cpp @@ -83,46 +83,6 @@ TEST_P( domatcopyAPI, FunctionalTest ) test_omatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/somatcopy_evt.cpp b/gtestsuite/testsuite/extension/omatcopy/somatcopy_evt.cpp index ec7ef49ab..e9aef91e2 100644 --- a/gtestsuite/testsuite/extension/omatcopy/somatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/somatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( somatcopyEVT, NanInfCheck ) test_omatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/somatcopy_generic.cpp b/gtestsuite/testsuite/extension/omatcopy/somatcopy_generic.cpp index 3cde09935..b8eec2168 100644 --- a/gtestsuite/testsuite/extension/omatcopy/somatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/somatcopy_generic.cpp @@ -83,46 +83,6 @@ TEST_P( somatcopyAPI, FunctionalTest ) test_omatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/test_omatcopy.h b/gtestsuite/testsuite/extension/omatcopy/test_omatcopy.h index 12b1835f3..a6b632d99 100644 --- a/gtestsuite/testsuite/extension/omatcopy/test_omatcopy.h +++ b/gtestsuite/testsuite/extension/omatcopy/test_omatcopy.h @@ -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 +class omatcopyGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class omatcopyEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/extension/omatcopy/zomatcopy_evt.cpp b/gtestsuite/testsuite/extension/omatcopy/zomatcopy_evt.cpp index f862bd100..1e8d22c63 100644 --- a/gtestsuite/testsuite/extension/omatcopy/zomatcopy_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/zomatcopy_evt.cpp @@ -87,46 +87,6 @@ TEST_P( zomatcopyEVT, NanInfCheck ) test_omatcopy( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy/zomatcopy_generic.cpp b/gtestsuite/testsuite/extension/omatcopy/zomatcopy_generic.cpp index 695661445..33c79d7bb 100644 --- a/gtestsuite/testsuite/extension/omatcopy/zomatcopy_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy/zomatcopy_generic.cpp @@ -83,46 +83,6 @@ TEST_P( zomatcopyAPI, FunctionalTest ) test_omatcopy( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_evt.cpp b/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_evt.cpp index b9bf3b1d4..15c9ba533 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_evt.cpp @@ -93,50 +93,6 @@ TEST_P( comatcopy2EVT, NanInfCheck ) test_omatcopy2( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_generic.cpp b/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_generic.cpp index f06ee3eae..716da5e63 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/comatcopy2_generic.cpp @@ -89,50 +89,6 @@ TEST_P( comatcopy2API, FunctionalTest ) test_omatcopy2( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_evt.cpp b/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_evt.cpp index a463b298c..c1a302b58 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_evt.cpp @@ -93,50 +93,6 @@ TEST_P( domatcopy2EVT, NanInfCheck ) test_omatcopy2( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_generic.cpp b/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_generic.cpp index 88b1014fa..4286ebf7f 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/domatcopy2_generic.cpp @@ -89,50 +89,6 @@ TEST_P( domatcopy2API, FunctionalTest ) test_omatcopy2( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_evt.cpp b/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_evt.cpp index 1af0ed4da..8e84ca8d1 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_evt.cpp @@ -93,50 +93,6 @@ TEST_P( somatcopy2EVT, NanInfCheck ) test_omatcopy2( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_generic.cpp b/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_generic.cpp index 59c67e1fe..86cac05e6 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/somatcopy2_generic.cpp @@ -89,50 +89,6 @@ TEST_P( somatcopy2API, FunctionalTest ) test_omatcopy2( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/test_omatcopy2.h b/gtestsuite/testsuite/extension/omatcopy2/test_omatcopy2.h index 8bd682ed9..60d762630 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/test_omatcopy2.h +++ b/gtestsuite/testsuite/extension/omatcopy2/test_omatcopy2.h @@ -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 +class omatcopy2GenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class comatcopy2EVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_evt.cpp b/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_evt.cpp index b0af8112b..6dbc3bc37 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_evt.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_evt.cpp @@ -93,50 +93,6 @@ TEST_P( zomatcopy2EVT, NanInfCheck ) test_omatcopy2( 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> 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::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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_generic.cpp b/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_generic.cpp index 695081456..ad30dba46 100644 --- a/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_generic.cpp +++ b/gtestsuite/testsuite/extension/omatcopy2/zomatcopy2_generic.cpp @@ -89,50 +89,6 @@ TEST_P( zomatcopy2API, FunctionalTest ) test_omatcopy2( 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> 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() ); #endif diff --git a/gtestsuite/testsuite/level1/addv/caddv_generic.cpp b/gtestsuite/testsuite/level1/addv/caddv_generic.cpp index cafbd965c..a281bb9f9 100644 --- a/gtestsuite/testsuite/level1/addv/caddv_generic.cpp +++ b/gtestsuite/testsuite/level1/addv/caddv_generic.cpp @@ -73,24 +73,6 @@ TEST_P( caddvGenericTest, RandomData ) test_addv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class caddvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/addv/daddv_generic.cpp b/gtestsuite/testsuite/level1/addv/daddv_generic.cpp index ac698a506..23b126fa6 100644 --- a/gtestsuite/testsuite/level1/addv/daddv_generic.cpp +++ b/gtestsuite/testsuite/level1/addv/daddv_generic.cpp @@ -72,24 +72,6 @@ TEST_P( daddvGenericTest, RandomData ) test_addv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class daddvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/addv/saddv_generic.cpp b/gtestsuite/testsuite/level1/addv/saddv_generic.cpp index ecb52c9fe..bd8b90ee5 100644 --- a/gtestsuite/testsuite/level1/addv/saddv_generic.cpp +++ b/gtestsuite/testsuite/level1/addv/saddv_generic.cpp @@ -72,24 +72,6 @@ TEST_P( saddvGenericTest, RandomData ) test_addv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class saddvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/addv/test_addv.h b/gtestsuite/testsuite/level1/addv/test_addv.h index 70b0a15eb..79c8df82a 100644 --- a/gtestsuite/testsuite/level1/addv/test_addv.h +++ b/gtestsuite/testsuite/level1/addv/test_addv.h @@ -68,3 +68,22 @@ void test_addv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, double thresh //---------------------------------------------------------- computediff( "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> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/addv/zaddv_generic.cpp b/gtestsuite/testsuite/level1/addv/zaddv_generic.cpp index 876a7b00e..ddbb5cf01 100644 --- a/gtestsuite/testsuite/level1/addv/zaddv_generic.cpp +++ b/gtestsuite/testsuite/level1/addv/zaddv_generic.cpp @@ -73,24 +73,6 @@ TEST_P( ZAddvGenericTest, RandomData ) test_addv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class ZAddvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/amaxv/camaxv_generic.cpp b/gtestsuite/testsuite/level1/amaxv/camaxv_generic.cpp index b8cb8f5cf..cce017466 100644 --- a/gtestsuite/testsuite/level1/amaxv/camaxv_generic.cpp +++ b/gtestsuite/testsuite/level1/amaxv/camaxv_generic.cpp @@ -58,28 +58,6 @@ TEST_P( camaxvGeneric, FunctionalTest ) test_amaxv( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/amaxv/damaxv_evt_testing.cpp b/gtestsuite/testsuite/level1/amaxv/damaxv_evt_testing.cpp index 5a7fa0f3e..72757c541 100644 --- a/gtestsuite/testsuite/level1/amaxv/damaxv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/amaxv/damaxv_evt_testing.cpp @@ -70,34 +70,6 @@ TEST_P( damaxvEVT, NaNInfCheck ) test_amaxv( 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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() ); /* @@ -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() ); @@ -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() ); diff --git a/gtestsuite/testsuite/level1/amaxv/damaxv_generic.cpp b/gtestsuite/testsuite/level1/amaxv/damaxv_generic.cpp index 0da6d3b3c..d78c2ef7f 100644 --- a/gtestsuite/testsuite/level1/amaxv/damaxv_generic.cpp +++ b/gtestsuite/testsuite/level1/amaxv/damaxv_generic.cpp @@ -58,28 +58,6 @@ TEST_P( damaxvGeneric, FunctionalTest ) test_amaxv( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/amaxv/samaxv_evt_testing.cpp b/gtestsuite/testsuite/level1/amaxv/samaxv_evt_testing.cpp index 9991bea8a..0aa43c6c7 100644 --- a/gtestsuite/testsuite/level1/amaxv/samaxv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/amaxv/samaxv_evt_testing.cpp @@ -70,34 +70,6 @@ TEST_P( samaxvEVT, NaNInfCheck ) test_amaxv( 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> 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::quiet_NaN(); static float Inf = std::numeric_limits::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() ); /* @@ -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() ); @@ -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() ); diff --git a/gtestsuite/testsuite/level1/amaxv/samaxv_generic.cpp b/gtestsuite/testsuite/level1/amaxv/samaxv_generic.cpp index f951c93db..173af7682 100644 --- a/gtestsuite/testsuite/level1/amaxv/samaxv_generic.cpp +++ b/gtestsuite/testsuite/level1/amaxv/samaxv_generic.cpp @@ -58,28 +58,6 @@ TEST_P( samaxvGeneric, FunctionalTest ) test_amaxv( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/amaxv/test_amaxv.h b/gtestsuite/testsuite/level1/amaxv/test_amaxv.h index d4d7a71a7..9c908e13b 100644 --- a/gtestsuite/testsuite/level1/amaxv/test_amaxv.h +++ b/gtestsuite/testsuite/level1/amaxv/test_amaxv.h @@ -101,3 +101,39 @@ static void test_amaxv( gtint_t n, gtint_t incx, gtint_t xi, T xi_exval, //---------------------------------------------------------- computediff( "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> 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 +class amaxvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/amaxv/zamaxv_generic.cpp b/gtestsuite/testsuite/level1/amaxv/zamaxv_generic.cpp index 669e033af..86102d6a8 100644 --- a/gtestsuite/testsuite/level1/amaxv/zamaxv_generic.cpp +++ b/gtestsuite/testsuite/level1/amaxv/zamaxv_generic.cpp @@ -58,28 +58,6 @@ TEST_P( zamaxvGeneric, FunctionalTest ) test_amaxv( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/axpbyv/caxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/caxpbyv_generic.cpp index e62614705..a8dd0f3f2 100644 --- a/gtestsuite/testsuite/level1/axpbyv/caxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/caxpbyv_generic.cpp @@ -106,37 +106,6 @@ TEST_P( caxpbyvGenericTest, RandomData ) test_axpbyv( 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> 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() ); // 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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/axpbyv/daxpbyv_evt_testing.cpp b/gtestsuite/testsuite/level1/axpbyv/daxpbyv_evt_testing.cpp index ec1c28b06..465e861b9 100644 --- a/gtestsuite/testsuite/level1/axpbyv/daxpbyv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/daxpbyv_evt_testing.cpp @@ -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> 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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()); // 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()); // 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()); // 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()); /* 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpbyv/daxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/daxpbyv_generic.cpp index 618dbf102..191ec0143 100644 --- a/gtestsuite/testsuite/level1/axpbyv/daxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/daxpbyv_generic.cpp @@ -105,37 +105,6 @@ TEST_P( daxpbyvGenericTest, RandomData ) test_axpbyv( 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> 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() ); #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() ); #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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/axpbyv/saxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/saxpbyv_generic.cpp index f9f89ab4f..25150c15e 100644 --- a/gtestsuite/testsuite/level1/axpbyv/saxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/saxpbyv_generic.cpp @@ -105,37 +105,6 @@ TEST_P( saxpbyvGenericTest, RandomData ) test_axpbyv( 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> 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() ); #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() ); #endif @@ -184,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(float(4.0)), // alpha ::testing::Values(float(2.0)) // beta ), - ::saxpbyvGenericTestPrint() + ::axpbyvGenericPrint() ); #ifndef TEST_BLIS_TYPED @@ -202,6 +171,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(4.0), // alpha ::testing::Values(-2.0) // beta ), - ::saxpbyvGenericTestPrint() + ::axpbyvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/axpbyv/test_axpbyv.h b/gtestsuite/testsuite/level1/axpbyv/test_axpbyv.h index d2f3e5644..d81847090 100644 --- a/gtestsuite/testsuite/level1/axpbyv/test_axpbyv.h +++ b/gtestsuite/testsuite/level1/axpbyv/test_axpbyv.h @@ -106,3 +106,62 @@ static void test_axpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh, true ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class axpbyvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class axpbyvEVTPrint +{ +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_evt_testing.cpp b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_evt_testing.cpp index 26022ade1..b1f27e547 100644 --- a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_evt_testing.cpp @@ -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> 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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()); // 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()); // 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()); // 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()); /* 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_generic.cpp index a4d6ba56a..f95e15f04 100644 --- a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv_generic.cpp @@ -106,39 +106,6 @@ TEST_P(zaxpbyvAccTest, RandomData) test_axpbyv(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> 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()); // 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()); // 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp b/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp index f7207789d..74e55634b 100644 --- a/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp @@ -92,39 +92,6 @@ TEST_P( daxpyfGenericTest, FunctionalTest ) test_axpyf( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/axpyf/test_axpyf.h b/gtestsuite/testsuite/level1/axpyf/test_axpyf.h index 04740fbb1..acb44d74e 100644 --- a/gtestsuite/testsuite/level1/axpyf/test_axpyf.h +++ b/gtestsuite/testsuite/level1/axpyf/test_axpyf.h @@ -91,3 +91,38 @@ static void test_axpyf( //---------------------------------------------------------- computediff( "y", m, y.data(), y_ref.data(), incy, thresh, true ); } + + +// Test-case logger : Used to print the test-case details +template +class axpyfGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/axpyv/caxpyv_generic.cpp b/gtestsuite/testsuite/level1/axpyv/caxpyv_generic.cpp index 28410547e..0c6c23f13 100644 --- a/gtestsuite/testsuite/level1/axpyv/caxpyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyv/caxpyv_generic.cpp @@ -81,35 +81,6 @@ TEST_P( caxpyvGenericTest, RandomData ) test_axpyv( 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> 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() ); // 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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/axpyv/daxpyv_evt_testing.cpp b/gtestsuite/testsuite/level1/axpyv/daxpyv_evt_testing.cpp index 3a8f04940..7432536f2 100644 --- a/gtestsuite/testsuite/level1/axpyv/daxpyv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/axpyv/daxpyv_evt_testing.cpp @@ -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> 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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()); // 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()); // 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()); /* 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()); // 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()); // 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()); // 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()); /* 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()); // 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpyv/daxpyv_generic.cpp b/gtestsuite/testsuite/level1/axpyv/daxpyv_generic.cpp index 75b2a0c06..f4ef065f6 100644 --- a/gtestsuite/testsuite/level1/axpyv/daxpyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyv/daxpyv_generic.cpp @@ -80,34 +80,6 @@ TEST_P( daxpyvGenericTest, RandomData ) test_axpyv( 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> 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() ); #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() ); #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() ); #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() ); #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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/axpyv/saxpyv_evt_testing.cpp b/gtestsuite/testsuite/level1/axpyv/saxpyv_evt_testing.cpp index 8f8981151..e43257550 100644 --- a/gtestsuite/testsuite/level1/axpyv/saxpyv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/axpyv/saxpyv_evt_testing.cpp @@ -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> 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> 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::quiet_NaN(); static float Inf = std::numeric_limits::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()); // 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()); // 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()); /* 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()); // 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()); // 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()); // 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()); /* 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()); // 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpyv/saxpyv_generic.cpp b/gtestsuite/testsuite/level1/axpyv/saxpyv_generic.cpp index 9e87d27d4..f3077e6b1 100644 --- a/gtestsuite/testsuite/level1/axpyv/saxpyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyv/saxpyv_generic.cpp @@ -80,34 +80,6 @@ TEST_P( saxpyvGeneric, FunctionalTest ) test_axpyv( 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> 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() ); #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() ); #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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/axpyv/test_axpyv.h b/gtestsuite/testsuite/level1/axpyv/test_axpyv.h index b342d0f73..58a9533fb 100644 --- a/gtestsuite/testsuite/level1/axpyv/test_axpyv.h +++ b/gtestsuite/testsuite/level1/axpyv/test_axpyv.h @@ -106,3 +106,58 @@ static void test_axpyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh, true ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class axpyvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class axpyvEVTPrint +{ +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; diff --git a/gtestsuite/testsuite/level1/axpyv/zaxpyv_evt_testing.cpp b/gtestsuite/testsuite/level1/axpyv/zaxpyv_evt_testing.cpp index 3fd574a45..11fc688b5 100644 --- a/gtestsuite/testsuite/level1/axpyv/zaxpyv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/axpyv/zaxpyv_evt_testing.cpp @@ -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> 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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()); // 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()); // 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()); // 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()); /* 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()); // 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()); diff --git a/gtestsuite/testsuite/level1/axpyv/zaxpyv_generic.cpp b/gtestsuite/testsuite/level1/axpyv/zaxpyv_generic.cpp index 4e004663e..2a15fa83d 100644 --- a/gtestsuite/testsuite/level1/axpyv/zaxpyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyv/zaxpyv_generic.cpp @@ -81,34 +81,6 @@ TEST_P( zaxpyvGenericTest, FunctionalTest ) test_axpyv( 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> 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() ); // 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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/copyv/ccopyv_generic.cpp b/gtestsuite/testsuite/level1/copyv/ccopyv_generic.cpp index 8a52a48b6..9c6b4976c 100644 --- a/gtestsuite/testsuite/level1/copyv/ccopyv_generic.cpp +++ b/gtestsuite/testsuite/level1/copyv/ccopyv_generic.cpp @@ -64,33 +64,6 @@ TEST_P( ccopyvGenericTest, RandomData ) test_copyv( 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> 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 diff --git a/gtestsuite/testsuite/level1/copyv/dcopyv_generic.cpp b/gtestsuite/testsuite/level1/copyv/dcopyv_generic.cpp index f6de9348a..24c0e3f48 100644 --- a/gtestsuite/testsuite/level1/copyv/dcopyv_generic.cpp +++ b/gtestsuite/testsuite/level1/copyv/dcopyv_generic.cpp @@ -64,33 +64,6 @@ TEST_P( dcopyvGenericTest, RandomData ) test_copyv( 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> 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 diff --git a/gtestsuite/testsuite/level1/copyv/scopyv_generic.cpp b/gtestsuite/testsuite/level1/copyv/scopyv_generic.cpp index 88aca1287..e29ced63b 100644 --- a/gtestsuite/testsuite/level1/copyv/scopyv_generic.cpp +++ b/gtestsuite/testsuite/level1/copyv/scopyv_generic.cpp @@ -64,33 +64,6 @@ TEST_P( scopyvGenericTest, RandomData ) test_copyv( 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> 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 diff --git a/gtestsuite/testsuite/level1/copyv/test_copyv.h b/gtestsuite/testsuite/level1/copyv/test_copyv.h index f78f9a995..b9a4aa27f 100644 --- a/gtestsuite/testsuite/level1/copyv/test_copyv.h +++ b/gtestsuite/testsuite/level1/copyv/test_copyv.h @@ -69,3 +69,22 @@ static void test_copyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy ) //---------------------------------------------------------- computediff( "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> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/copyv/zcopyv_generic.cpp b/gtestsuite/testsuite/level1/copyv/zcopyv_generic.cpp index 3d58a2aac..ba15655b7 100644 --- a/gtestsuite/testsuite/level1/copyv/zcopyv_generic.cpp +++ b/gtestsuite/testsuite/level1/copyv/zcopyv_generic.cpp @@ -64,33 +64,6 @@ TEST_P( zcopyvGenericTest, RandomData ) test_copyv( 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> 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 diff --git a/gtestsuite/testsuite/level1/dotv/cdotv_generic.cpp b/gtestsuite/testsuite/level1/dotv/cdotv_generic.cpp index b9e166d46..f9686c87d 100644 --- a/gtestsuite/testsuite/level1/dotv/cdotv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotv/cdotv_generic.cpp @@ -78,35 +78,6 @@ TEST_P( cdotvGenericTest, RandomData ) test_dotv( 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> 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 diff --git a/gtestsuite/testsuite/level1/dotv/ddotv_evt_testing.cpp b/gtestsuite/testsuite/level1/dotv/ddotv_evt_testing.cpp index 97c979d92..d38fdbd52 100644 --- a/gtestsuite/testsuite/level1/dotv/ddotv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/dotv/ddotv_evt_testing.cpp @@ -86,44 +86,6 @@ TEST_P( ddotv_EVT, ExceptionData ) test_dotv( 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::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() ); @@ -226,7 +188,7 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( NaN, Inf, -Inf ) ), - ::ddotv_EVTPrint() + ::dotvEVTPrint() ); // 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() ); // 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() ); // 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() ); // 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() ); // 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() ); // 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() ); diff --git a/gtestsuite/testsuite/level1/dotv/ddotv_generic.cpp b/gtestsuite/testsuite/level1/dotv/ddotv_generic.cpp index 7991ec2ca..ac9e4e503 100644 --- a/gtestsuite/testsuite/level1/dotv/ddotv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotv/ddotv_generic.cpp @@ -77,35 +77,6 @@ TEST_P( ddotvGenericTest, RandomData ) test_dotv( 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> 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 diff --git a/gtestsuite/testsuite/level1/dotv/sdotv_generic.cpp b/gtestsuite/testsuite/level1/dotv/sdotv_generic.cpp index 803fdc90b..1fc2a828f 100644 --- a/gtestsuite/testsuite/level1/dotv/sdotv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotv/sdotv_generic.cpp @@ -77,35 +77,6 @@ TEST_P( sdotvGenericTest, RandomData ) test_dotv( 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> 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 diff --git a/gtestsuite/testsuite/level1/dotv/test_dotv.h b/gtestsuite/testsuite/level1/dotv/test_dotv.h index 65f041134..2d0f48829 100644 --- a/gtestsuite/testsuite/level1/dotv/test_dotv.h +++ b/gtestsuite/testsuite/level1/dotv/test_dotv.h @@ -121,3 +121,55 @@ static void test_dotv( char conjx, char conjy, gtint_t n, //---------------------------------------------------------- computediff( "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> 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 +class dotvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; diff --git a/gtestsuite/testsuite/level1/dotv/zdotv_generic.cpp b/gtestsuite/testsuite/level1/dotv/zdotv_generic.cpp index cc7995d9f..ef0ff02c1 100644 --- a/gtestsuite/testsuite/level1/dotv/zdotv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotv/zdotv_generic.cpp @@ -78,35 +78,6 @@ TEST_P( zdotvGenericTest, RandomData ) test_dotv( 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> 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 diff --git a/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp b/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp index 7e0ce6c03..1bd8cb850 100644 --- a/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp @@ -106,43 +106,6 @@ TEST_P( ddotxffGenericTest, FunctionalTest ) test_dotxf( 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> 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() ); diff --git a/gtestsuite/testsuite/level1/dotxf/test_dotxf.h b/gtestsuite/testsuite/level1/dotxf/test_dotxf.h index 39d0167d9..58095df0f 100644 --- a/gtestsuite/testsuite/level1/dotxf/test_dotxf.h +++ b/gtestsuite/testsuite/level1/dotxf/test_dotxf.h @@ -87,3 +87,42 @@ static void test_dotxf( //---------------------------------------------------------- computediff( "y", m, y.data(), y_ref.data(), incy, thresh, true ); } + + +// Test-case logger : Used to print the test-case details +template +class dotxfGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/dotxv/cdotxv_generic.cpp b/gtestsuite/testsuite/level1/dotxv/cdotxv_generic.cpp index 979ecdc21..526f76c39 100644 --- a/gtestsuite/testsuite/level1/dotxv/cdotxv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxv/cdotxv_generic.cpp @@ -105,33 +105,6 @@ TEST_P( cdotxvGenericTest, RandomData ) test_dotxv( 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> 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/dotxv/ddotxv_generic.cpp b/gtestsuite/testsuite/level1/dotxv/ddotxv_generic.cpp index cedaf0b3a..13e7e4293 100644 --- a/gtestsuite/testsuite/level1/dotxv/ddotxv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxv/ddotxv_generic.cpp @@ -104,33 +104,6 @@ TEST_P( ddotxvGenericTest, RandomData ) test_dotxv(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> 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/dotxv/sdotxv_generic.cpp b/gtestsuite/testsuite/level1/dotxv/sdotxv_generic.cpp index fe8659966..097289888 100644 --- a/gtestsuite/testsuite/level1/dotxv/sdotxv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxv/sdotxv_generic.cpp @@ -104,33 +104,6 @@ TEST_P( sdotxvGenericTest, RandomData ) test_dotxv( 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> 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/dotxv/test_dotxv.h b/gtestsuite/testsuite/level1/dotxv/test_dotxv.h index 40924aad7..d8e31aa76 100644 --- a/gtestsuite/testsuite/level1/dotxv/test_dotxv.h +++ b/gtestsuite/testsuite/level1/dotxv/test_dotxv.h @@ -73,3 +73,29 @@ static void test_dotxv( gtint_t n, char conjx, char conjy, T alpha, //---------------------------------------------------------- computediff( "rho", rho, rho_ref, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class dotxvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/dotxv/zdotxv_generic.cpp b/gtestsuite/testsuite/level1/dotxv/zdotxv_generic.cpp index e4b1ea993..dbfb88256 100644 --- a/gtestsuite/testsuite/level1/dotxv/zdotxv_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxv/zdotxv_generic.cpp @@ -105,33 +105,6 @@ TEST_P( zdotxvGenericTest, RandomData ) test_dotxv(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> 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/scal2v/cscal2v_generic.cpp b/gtestsuite/testsuite/level1/scal2v/cscal2v_generic.cpp index 8491218e5..789a7f564 100644 --- a/gtestsuite/testsuite/level1/scal2v/cscal2v_generic.cpp +++ b/gtestsuite/testsuite/level1/scal2v/cscal2v_generic.cpp @@ -82,28 +82,6 @@ TEST_P( cscal2vGenericTest, RandomData ) test_scal2v( 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> 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() ); @@ -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() ); #endif diff --git a/gtestsuite/testsuite/level1/scal2v/dscal2v_generic.cpp b/gtestsuite/testsuite/level1/scal2v/dscal2v_generic.cpp index 9d4bac9e3..10fdee368 100644 --- a/gtestsuite/testsuite/level1/scal2v/dscal2v_generic.cpp +++ b/gtestsuite/testsuite/level1/scal2v/dscal2v_generic.cpp @@ -81,28 +81,6 @@ TEST_P( dscal2vGenericTest, RandomData ) test_scal2v( 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> 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/scal2v/sscal2v_generic.cpp b/gtestsuite/testsuite/level1/scal2v/sscal2v_generic.cpp index c59ec45af..2266710fd 100644 --- a/gtestsuite/testsuite/level1/scal2v/sscal2v_generic.cpp +++ b/gtestsuite/testsuite/level1/scal2v/sscal2v_generic.cpp @@ -81,29 +81,6 @@ TEST_P( sscal2vGenericTest, RandomData ) test_scal2v( 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> 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/scal2v/test_scal2v.h b/gtestsuite/testsuite/level1/scal2v/test_scal2v.h index 25af36847..930c1198f 100644 --- a/gtestsuite/testsuite/level1/scal2v/test_scal2v.h +++ b/gtestsuite/testsuite/level1/scal2v/test_scal2v.h @@ -68,3 +68,25 @@ static void test_scal2v(char conjx, gtint_t n, gtint_t incx, gtint_t incy, T alp //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class scal2vGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/scal2v/zscal2v_generic.cpp b/gtestsuite/testsuite/level1/scal2v/zscal2v_generic.cpp index e0ce0d1ac..20a7bd420 100644 --- a/gtestsuite/testsuite/level1/scal2v/zscal2v_generic.cpp +++ b/gtestsuite/testsuite/level1/scal2v/zscal2v_generic.cpp @@ -83,28 +83,6 @@ TEST_P( zscal2vGenericTest, RandomData ) test_scal2v( 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> 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() ); @@ -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() ); #endif diff --git a/gtestsuite/testsuite/level1/scalv/cscalv_generic.cpp b/gtestsuite/testsuite/level1/scalv/cscalv_generic.cpp index f8a8f08b3..d2ab15b09 100644 --- a/gtestsuite/testsuite/level1/scalv/cscalv_generic.cpp +++ b/gtestsuite/testsuite/level1/scalv/cscalv_generic.cpp @@ -78,33 +78,6 @@ TEST_P( cscalvGenericTest, RandomData ) test_scalv( 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> 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() ); @@ -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() ); #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() ); #endif diff --git a/gtestsuite/testsuite/level1/scalv/dscalv_evt_testing.cpp b/gtestsuite/testsuite/level1/scalv/dscalv_evt_testing.cpp index c84271ca5..4976bba0a 100644 --- a/gtestsuite/testsuite/level1/scalv/dscalv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/scalv/dscalv_evt_testing.cpp @@ -80,37 +80,6 @@ TEST_P( dscalv_EVT, ExceptionData ) test_scalv( 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); @@ -173,7 +142,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::dscalv_EVTPrint() + (::scalvEVTPrint()) ); // Tests for Zen3 Architecture. @@ -247,7 +216,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::dscalv_EVTPrint() + (::scalvEVTPrint()) ); // EVT with non-unit stride vector containing Infs/NaNs. @@ -285,7 +254,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::dscalv_EVTPrint() + (::scalvEVTPrint()) ); // 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()) ); // 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()) ); // 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()) ); diff --git a/gtestsuite/testsuite/level1/scalv/dscalv_generic.cpp b/gtestsuite/testsuite/level1/scalv/dscalv_generic.cpp index 2845138d7..f51d76979 100644 --- a/gtestsuite/testsuite/level1/scalv/dscalv_generic.cpp +++ b/gtestsuite/testsuite/level1/scalv/dscalv_generic.cpp @@ -77,33 +77,6 @@ TEST_P( dscalvGenericTest, RandomData ) test_scalv( 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> 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() ); INSTANTIATE_TEST_SUITE_P( @@ -147,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P( double(-3.0) ) ), - ::dscalvGenericTestPrint() + ::scalvGenericPrint() ); #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() ); #endif @@ -194,6 +167,6 @@ INSTANTIATE_TEST_SUITE_P( double( 7.0) ) ), - ::dscalvGenericTestPrint() + ::scalvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/scalv/sscalv_generic.cpp b/gtestsuite/testsuite/level1/scalv/sscalv_generic.cpp index 2fd731fa1..46738ea13 100644 --- a/gtestsuite/testsuite/level1/scalv/sscalv_generic.cpp +++ b/gtestsuite/testsuite/level1/scalv/sscalv_generic.cpp @@ -77,33 +77,6 @@ TEST_P( sscalvGenericTest, RandomData ) test_scalv( 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> 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() ); #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() ); #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() ); @@ -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() ); #endif diff --git a/gtestsuite/testsuite/level1/scalv/test_scalv.h b/gtestsuite/testsuite/level1/scalv/test_scalv.h index b194d417a..d7292cca7 100644 --- a/gtestsuite/testsuite/level1/scalv/test_scalv.h +++ b/gtestsuite/testsuite/level1/scalv/test_scalv.h @@ -100,3 +100,47 @@ static void test_scalv( char conja_alpha, gtint_t n, gtint_t incx, gtint_t xi, //---------------------------------------------------------- computediff( "x", n, x.data(), x_ref.data(), incx, thresh, true ); } + + +// Test-case logger : Used to print the test-case details based on parameters +template +class scalvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class scalvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/scalv/zdscalv_evt_testing.cpp b/gtestsuite/testsuite/level1/scalv/zdscalv_evt_testing.cpp index 07d90d36e..74503d788 100644 --- a/gtestsuite/testsuite/level1/scalv/zdscalv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/scalv/zdscalv_evt_testing.cpp @@ -85,38 +85,6 @@ TEST_P( zdscalvEVT, NaNInfCheck ) test_scalv( 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); @@ -210,7 +178,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::zdscalvEVTPrint() + (::scalvEVTPrint()) ); // Tests for Zen4 Architecture. @@ -275,7 +243,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::zdscalvEVTPrint() + (::scalvEVTPrint()) ); // EVT with non-unit stride vector containing Infs/NaNs. @@ -315,7 +283,7 @@ INSTANTIATE_TEST_SUITE_P( double( 7.3) ) ), - ::zdscalvEVTPrint() + (::scalvEVTPrint()) ); // 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()) ); // 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()) ); // 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()) ); diff --git a/gtestsuite/testsuite/level1/scalv/zscalv_evt_testing.cpp b/gtestsuite/testsuite/level1/scalv/zscalv_evt_testing.cpp index 7b34a5483..e7c4b6e61 100644 --- a/gtestsuite/testsuite/level1/scalv/zscalv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/scalv/zscalv_evt_testing.cpp @@ -84,38 +84,6 @@ TEST_P( zscalvEVT, NaNInfCheck ) test_scalv( 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> 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::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); @@ -167,7 +135,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{ 7.3, 5.1} ) ), - ::zscalvEVTPrint() + (::scalvEVTPrint()) ); // EVT with non-unit stride vector containing Infs/NaNs. @@ -206,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{ 7.3, 5.1} ) ), - ::zscalvEVTPrint() + (::scalvEVTPrint()) ); // EVT with alpha containing Infs/NaNs on a unit stride vector. @@ -240,7 +208,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{-Inf, -Inf} ) ), - ::zscalvEVTPrint() + (::scalvEVTPrint()) ); // EVT with alpha containing Infs/NaNs on a unit stride vector. @@ -274,5 +242,5 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{-Inf, -Inf} ) ), - ::zscalvEVTPrint() + (::scalvEVTPrint()) ); diff --git a/gtestsuite/testsuite/level1/scalv/zscalv_generic.cpp b/gtestsuite/testsuite/level1/scalv/zscalv_generic.cpp index 0aad9274b..e726d7753 100644 --- a/gtestsuite/testsuite/level1/scalv/zscalv_generic.cpp +++ b/gtestsuite/testsuite/level1/scalv/zscalv_generic.cpp @@ -78,33 +78,6 @@ TEST_P( zscalvGenericTest, RandomData ) test_scalv( 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> 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() ); @@ -159,5 +132,5 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{ 7.3, 5.1} ) ), - ::zscalvGenericTestPrint() + ::scalvGenericPrint() ); diff --git a/gtestsuite/testsuite/level1/setv/csetv_generic.cpp b/gtestsuite/testsuite/level1/setv/csetv_generic.cpp index 67700988f..63eb90eef 100644 --- a/gtestsuite/testsuite/level1/setv/csetv_generic.cpp +++ b/gtestsuite/testsuite/level1/setv/csetv_generic.cpp @@ -61,22 +61,6 @@ TEST_P( csetvGenericTest, RandomData ) test_setv( conjalpha, n, alpha, incx ); } -// Prints the test case combination -class csetvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/setv/dsetv_generic.cpp b/gtestsuite/testsuite/level1/setv/dsetv_generic.cpp index d5909d255..f8a2c6df9 100644 --- a/gtestsuite/testsuite/level1/setv/dsetv_generic.cpp +++ b/gtestsuite/testsuite/level1/setv/dsetv_generic.cpp @@ -61,22 +61,6 @@ TEST_P( dsetvGenericTest, RandomData ) test_setv( conjalpha, n, alpha, incx ); } -// Prints the test case combination -class dsetvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/setv/ssetv_generic.cpp b/gtestsuite/testsuite/level1/setv/ssetv_generic.cpp index e64e80080..e28f9f875 100644 --- a/gtestsuite/testsuite/level1/setv/ssetv_generic.cpp +++ b/gtestsuite/testsuite/level1/setv/ssetv_generic.cpp @@ -61,22 +61,6 @@ TEST_P( ssetvGenericTest, RandomData ) test_setv( conjalpha, n, alpha, incx ); } -// Prints the test case combination -class ssetvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/setv/test_setv.h b/gtestsuite/testsuite/level1/setv/test_setv.h index da98788ec..9357e4dc1 100644 --- a/gtestsuite/testsuite/level1/setv/test_setv.h +++ b/gtestsuite/testsuite/level1/setv/test_setv.h @@ -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> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/setv/zsetv_generic.cpp b/gtestsuite/testsuite/level1/setv/zsetv_generic.cpp index 0ab9e0c32..542af8843 100644 --- a/gtestsuite/testsuite/level1/setv/zsetv_generic.cpp +++ b/gtestsuite/testsuite/level1/setv/zsetv_generic.cpp @@ -61,22 +61,6 @@ TEST_P( zsetvGenericTest, RandomData ) test_setv( conjalpha, n, alpha, incx ); } -// Prints the test case combination -class zsetvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/subv/csubv_evt_testing.cpp b/gtestsuite/testsuite/level1/subv/csubv_evt_testing.cpp index ef6617610..1b531d0ef 100644 --- a/gtestsuite/testsuite/level1/subv/csubv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/subv/csubv_evt_testing.cpp @@ -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> 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::quiet_NaN(); @@ -157,7 +127,7 @@ INSTANTIATE_TEST_SUITE_P( // value on y ::testing::Values(scomplex{0.0, 0.0}) ), - ::csubvEVTPrint() + ::subvEVTPrint() ); // 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/subv/csubv_generic.cpp b/gtestsuite/testsuite/level1/subv/csubv_generic.cpp index a2f492ea1..f23b980b9 100644 --- a/gtestsuite/testsuite/level1/subv/csubv_generic.cpp +++ b/gtestsuite/testsuite/level1/subv/csubv_generic.cpp @@ -74,24 +74,6 @@ TEST_P( csubvGenericTest, FunctionalTest ) test_subv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class csubvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/subv/dsubv_evt_testing.cpp b/gtestsuite/testsuite/level1/subv/dsubv_evt_testing.cpp index 8b4128152..40cc845ca 100644 --- a/gtestsuite/testsuite/level1/subv/dsubv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/subv/dsubv_evt_testing.cpp @@ -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> 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::quiet_NaN(); @@ -154,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P( // value on y ::testing::Values(double(0.0)) ), - ::dsubvEVTPrint() + ::subvEVTPrint() ); // 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/subv/dsubv_generic.cpp b/gtestsuite/testsuite/level1/subv/dsubv_generic.cpp index 1c7187edc..e42ba4c96 100644 --- a/gtestsuite/testsuite/level1/subv/dsubv_generic.cpp +++ b/gtestsuite/testsuite/level1/subv/dsubv_generic.cpp @@ -73,24 +73,6 @@ TEST_P( dsubvGenericTest, FunctionalTest ) test_subv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class dsubvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/subv/ssubv_evt_testing.cpp b/gtestsuite/testsuite/level1/subv/ssubv_evt_testing.cpp index 2898cac27..6785080ee 100644 --- a/gtestsuite/testsuite/level1/subv/ssubv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/subv/ssubv_evt_testing.cpp @@ -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> 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::quiet_NaN(); @@ -154,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P( // value on y ::testing::Values(float(0.0)) ), - ::ssubvEVTPrint() + ::subvEVTPrint() ); // 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() ); // 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() ); // 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() ); #endif diff --git a/gtestsuite/testsuite/level1/subv/ssubv_generic.cpp b/gtestsuite/testsuite/level1/subv/ssubv_generic.cpp index 061751536..29ad62a2a 100644 --- a/gtestsuite/testsuite/level1/subv/ssubv_generic.cpp +++ b/gtestsuite/testsuite/level1/subv/ssubv_generic.cpp @@ -73,24 +73,6 @@ TEST_P( ssubvGenericTest, FunctionalTest ) test_subv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class ssubvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 diff --git a/gtestsuite/testsuite/level1/subv/test_subv.h b/gtestsuite/testsuite/level1/subv/test_subv.h index 2be3f0cdb..f4f4508c9 100644 --- a/gtestsuite/testsuite/level1/subv/test_subv.h +++ b/gtestsuite/testsuite/level1/subv/test_subv.h @@ -100,3 +100,52 @@ static void test_subv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, //---------------------------------------------------------- computediff( "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> 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 +class subvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/subv/zsubv_evt_testing.cpp b/gtestsuite/testsuite/level1/subv/zsubv_evt_testing.cpp index 05c209326..59c3c19bd 100644 --- a/gtestsuite/testsuite/level1/subv/zsubv_evt_testing.cpp +++ b/gtestsuite/testsuite/level1/subv/zsubv_evt_testing.cpp @@ -89,36 +89,6 @@ TEST_P( zsubvEVT, 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 zsubvEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> 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); - 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::quiet_NaN(); @@ -157,7 +127,7 @@ INSTANTIATE_TEST_SUITE_P( // value on y ::testing::Values(dcomplex{0.0, 0.0}) ), - ::zsubvEVTPrint() + ::subvEVTPrint() ); // Exception value testing(on Y vector alone) with unit strides on zen3 @@ -193,7 +163,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{4.5, -Inf}, dcomplex{NaN, Inf}, dcomplex{NaN, -Inf}) ), - ::zsubvEVTPrint() + ::subvEVTPrint() ); // Exception value testing(on X and Y vectors) with unit strides on zen3 @@ -234,7 +204,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{4.5, -Inf}, dcomplex{NaN, Inf}, dcomplex{NaN, -Inf}) ), - ::zsubvEVTPrint() + ::subvEVTPrint() ); // Exception value testing(on X & Y vectors) with non-unit strides. @@ -272,6 +242,6 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{4.5, -Inf}, dcomplex{NaN, Inf}, dcomplex{0.0, 0.0}, dcomplex{NaN, -Inf}) ), - ::zsubvEVTPrint() + ::subvEVTPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/subv/zsubv_generic.cpp b/gtestsuite/testsuite/level1/subv/zsubv_generic.cpp index e1dd9e851..56b629b67 100644 --- a/gtestsuite/testsuite/level1/subv/zsubv_generic.cpp +++ b/gtestsuite/testsuite/level1/subv/zsubv_generic.cpp @@ -74,24 +74,6 @@ TEST_P( zsubvGenericTest, FunctionalTest ) test_subv( conj_x, n, incx, incy, thresh ); } -// Prints the test case combination -class zsubvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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_zsubv"; - 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) ) ), - ::zsubvGenericTestPrint() + ::subvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/swapv/cswapv_generic.cpp b/gtestsuite/testsuite/level1/swapv/cswapv_generic.cpp index ab6bd6d81..40ef1313d 100644 --- a/gtestsuite/testsuite/level1/swapv/cswapv_generic.cpp +++ b/gtestsuite/testsuite/level1/swapv/cswapv_generic.cpp @@ -60,22 +60,6 @@ TEST_P( cswapvAPI, FunctionalTest ) test_swapv( n, incx, incy ); } -// Prints the test case combination -class cswapvAPIPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<0>(str.param); - gtint_t incx = std::get<1>(str.param); - gtint_t incy = std::get<2>(str.param); - std::string str_name = "bli"; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( UnitIncrements, cswapvAPI, @@ -95,7 +79,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::cswapvAPIPrint() + ::swapvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -117,5 +101,5 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(100), gtint_t(-200) ) ), - ::cswapvAPIPrint() + ::swapvGenericPrint() ); diff --git a/gtestsuite/testsuite/level1/swapv/dswapv_generic.cpp b/gtestsuite/testsuite/level1/swapv/dswapv_generic.cpp index 21043cfc5..ef59ad0a1 100644 --- a/gtestsuite/testsuite/level1/swapv/dswapv_generic.cpp +++ b/gtestsuite/testsuite/level1/swapv/dswapv_generic.cpp @@ -60,22 +60,6 @@ TEST_P( dswapvAPI, FunctionalTest ) test_swapv( n, incx, incy ); } -// Prints the test case combination -class dswapvAPIPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<0>(str.param); - gtint_t incx = std::get<1>(str.param); - gtint_t incy = std::get<2>(str.param); - std::string str_name = "bli"; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - return str_name; - } -}; - /*************************************************************************/ /* When n values are 32, 16, 8, 4 it is avx2 optimised */ /* Values to be tested to cover all loops */ @@ -107,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::dswapvAPIPrint() + ::swapvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -129,5 +113,5 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(100), gtint_t(-500) ) ), - ::dswapvAPIPrint() + ::swapvGenericPrint() ); diff --git a/gtestsuite/testsuite/level1/swapv/sswapv_generic.cpp b/gtestsuite/testsuite/level1/swapv/sswapv_generic.cpp index a28650b7b..8f4eeafd8 100644 --- a/gtestsuite/testsuite/level1/swapv/sswapv_generic.cpp +++ b/gtestsuite/testsuite/level1/swapv/sswapv_generic.cpp @@ -60,22 +60,6 @@ TEST_P( sswapvAPI, FunctionalTest ) test_swapv( n, incx, incy ); } -// Prints the test case combination -class sswapvAPIPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<0>(str.param); - gtint_t incx = std::get<1>(str.param); - gtint_t incy = std::get<2>(str.param); - std::string str_name = "bli"; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - return str_name; - } -}; - /*****************************************************************/ /* When n values are 64, 32, 16, 8 it is avx2 optimised */ /* Values to be tested to cover all loops */ @@ -107,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::sswapvAPIPrint() + ::swapvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -129,5 +113,5 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(500), gtint_t(-200) ) ), - ::sswapvAPIPrint() + ::swapvGenericPrint() ); diff --git a/gtestsuite/testsuite/level1/swapv/test_swapv.h b/gtestsuite/testsuite/level1/swapv/test_swapv.h index cb03a3b6c..c05665d3d 100644 --- a/gtestsuite/testsuite/level1/swapv/test_swapv.h +++ b/gtestsuite/testsuite/level1/swapv/test_swapv.h @@ -67,3 +67,20 @@ static void test_swapv( gtint_t n, gtint_t incx, gtint_t incy ) computediff( n, x.data(), x_ref.data(), y.data(), y_ref.data(), incx, incy, false ); } + +// Test-case logger : Used to print the test-case details based on parameters +class swapvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + gtint_t n = std::get<0>(str.param); + gtint_t incx = std::get<1>(str.param); + gtint_t incy = std::get<2>(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 += "_incy_" + testinghelpers::get_value_string(incy); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level1/swapv/zswapv_generic.cpp b/gtestsuite/testsuite/level1/swapv/zswapv_generic.cpp index 1911d1974..e2378be70 100644 --- a/gtestsuite/testsuite/level1/swapv/zswapv_generic.cpp +++ b/gtestsuite/testsuite/level1/swapv/zswapv_generic.cpp @@ -60,22 +60,6 @@ TEST_P( zswapvAPI, FunctionalTest ) test_swapv( n, incx, incy ); } -// Prints the test case combination -class zswapvAPIPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<0>(str.param); - gtint_t incx = std::get<1>(str.param); - gtint_t incy = std::get<2>(str.param); - std::string str_name = "bli"; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( UnitIncrements, zswapvAPI, @@ -95,7 +79,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::zswapvAPIPrint() + ::swapvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -117,5 +101,5 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(100), gtint_t(-200) ) ), - ::zswapvAPIPrint() + ::swapvGenericPrint() ); diff --git a/gtestsuite/testsuite/level1/xpbyv/cxpbyv_generic.cpp b/gtestsuite/testsuite/level1/xpbyv/cxpbyv_generic.cpp index 40e1bce9c..525503477 100644 --- a/gtestsuite/testsuite/level1/xpbyv/cxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/xpbyv/cxpbyv_generic.cpp @@ -84,29 +84,6 @@ TEST_P( cxpbyvGenericTest, RandomData ) test_xpbyv( conj_x, n, 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 cxpbyvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 beta = std::get<4>(str.param); - std::string str_name = "bli_cxpbyv"; - 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 += "_beta_" + testinghelpers::get_value_string(beta); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing for generic and main use of cxpby. INSTANTIATE_TEST_SUITE_P( @@ -119,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}) // beta ), - ::cxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); // Test for non-unit increments. @@ -135,6 +112,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(33)), /*(gtint_t(-12), gtint_t(-4))*/ // stride size for y ::testing::Values(scomplex{4.0, 3.1}) // beta ), - ::cxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/xpbyv/dxpbyv_generic.cpp b/gtestsuite/testsuite/level1/xpbyv/dxpbyv_generic.cpp index 2d294e492..c7be5e5ce 100644 --- a/gtestsuite/testsuite/level1/xpbyv/dxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/xpbyv/dxpbyv_generic.cpp @@ -83,29 +83,6 @@ TEST_P( dxpbyvGenericTest, RandomData ) test_xpbyv( conj_x, n, 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 dxpbyvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 beta = std::get<4>(str.param); - std::string str_name = "bli_dxpbyv"; - 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 += "_beta_" + testinghelpers::get_value_string(beta); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing for generic and main use of caxpy. INSTANTIATE_TEST_SUITE_P( @@ -118,7 +95,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(double(2.0), double(-2.0)) // beta ), - ::dxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); @@ -135,7 +112,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(double(2.0)) // beta ), - ::dxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); @@ -152,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(33)), /*(gtint_t(-12), gtint_t(-4))*/// stride size for y ::testing::Values(double(4.0)) // beta ), - ::dxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/xpbyv/sxpbyv_generic.cpp b/gtestsuite/testsuite/level1/xpbyv/sxpbyv_generic.cpp index 1ba5f1d31..2bb0016f5 100644 --- a/gtestsuite/testsuite/level1/xpbyv/sxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/xpbyv/sxpbyv_generic.cpp @@ -83,29 +83,6 @@ TEST_P( sxpbyvGenericTest, RandomData ) test_xpbyv( conj_x, n, 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 sxpbyvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 beta = std::get<4>(str.param); - std::string str_name = "bli_sxpbyv"; - 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 += "_beta_" + testinghelpers::get_value_string(beta); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing for generic and main use of caxpy. INSTANTIATE_TEST_SUITE_P( @@ -118,7 +95,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(float(2.0), float(-2.0)) // beta ), - ::sxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); // Test when conjugate of x is used as an argument. This option is BLIS-api specific. @@ -134,7 +111,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(float(2.0)) // beta ), - ::sxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); @@ -151,6 +128,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(33)), /*(gtint_t(-12), gtint_t(-4))*/// stride size for y ::testing::Values(float(4.0)) // beta ), - ::sxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level1/xpbyv/test_xpbyv.h b/gtestsuite/testsuite/level1/xpbyv/test_xpbyv.h index e4bb9a70e..b042946bd 100644 --- a/gtestsuite/testsuite/level1/xpbyv/test_xpbyv.h +++ b/gtestsuite/testsuite/level1/xpbyv/test_xpbyv.h @@ -69,3 +69,24 @@ static void test_xpbyv( char conjx, gtint_t n, gtint_t incx, gtint_t incy, //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class xpbyvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 beta = std::get<4>(str.param); + std::string str_name = "bli_cxpbyv"; + 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 += "_beta_" + testinghelpers::get_value_string(beta); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level1/xpbyv/zxpbyv_generic.cpp b/gtestsuite/testsuite/level1/xpbyv/zxpbyv_generic.cpp index 523f3b97e..3550a3d7b 100644 --- a/gtestsuite/testsuite/level1/xpbyv/zxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/xpbyv/zxpbyv_generic.cpp @@ -84,29 +84,6 @@ TEST_P( zxpbyvGenericTest, RandomData ) test_xpbyv( conj_x, n, 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 zxpbyvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 beta = std::get<4>(str.param); - std::string str_name = "bli_zxpbyv"; - 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 += "_beta_" + testinghelpers::get_value_string(beta); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing for generic and main use of zaxpby. INSTANTIATE_TEST_SUITE_P( @@ -119,7 +96,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), /*(gtint_t(-12), gtint_t(-4))*/ // stride size for y ::testing::Values(dcomplex{2.0, -1.0}, dcomplex{-2.0, 3.0}) // beta ), - ::zxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); // Test for non-unit increments. @@ -135,6 +112,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(33)), /*(gtint_t(-12), gtint_t(-4))*/ // stride size for y ::testing::Values(dcomplex{4.0, 3.1}) // beta ), - ::zxpbyvGenericTestPrint() + ::xpbyvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level2/gemv/cgemv_evt_testing.cpp b/gtestsuite/testsuite/level2/gemv/cgemv_evt_testing.cpp index 18d141954..fae832d5c 100644 --- a/gtestsuite/testsuite/level2/gemv/cgemv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/gemv/cgemv_evt_testing.cpp @@ -116,49 +116,6 @@ TEST_P(cgemvEVT, NaNInfCheck) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test, is_evt_test, a_exval, x_exval, y_exval ); } -class cgemvEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - T a_exval = std::get<9>(str.param); - T x_exval = std::get<10>(str.param); - T y_exval = std::get<11>(str.param); - gtint_t ld_inc = std::get<12>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( matrix_vector_unitStride, cgemvEVT, @@ -222,7 +179,7 @@ INSTANTIATE_TEST_SUITE_P( T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::cgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -276,7 +233,7 @@ INSTANTIATE_TEST_SUITE_P( T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::cgemvEVTPrint() + ::gemvEVTPrint() ); @@ -328,7 +285,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::cgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -367,5 +324,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::cgemvEVTPrint() + ::gemvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/cgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/cgemv_generic.cpp index eeb46879b..ffb0f72a9 100644 --- a/gtestsuite/testsuite/level2/gemv/cgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/cgemv_generic.cpp @@ -105,44 +105,6 @@ TEST_P(cgemvGeneric, FunctionalTest) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test ); } -class cgemvGenericPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + (( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( Blackbox, cgemvGeneric, @@ -163,7 +125,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -186,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -209,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); @@ -234,7 +196,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -257,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); @@ -281,7 +243,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -304,7 +266,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(57), gtint_t(119)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -328,5 +290,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(190)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::cgemvGenericPrint() + ::gemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/dgemv_evt_testing.cpp b/gtestsuite/testsuite/level2/gemv/dgemv_evt_testing.cpp index 594b0dbf2..0eb4476d3 100644 --- a/gtestsuite/testsuite/level2/gemv/dgemv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/gemv/dgemv_evt_testing.cpp @@ -115,48 +115,6 @@ TEST_P(dgemvEVT, NaNInfCheck) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test, is_evt_test, a_exval, x_exval, y_exval ); } -class dgemvEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - T a_exval = std::get<9>(str.param); - T x_exval = std::get<10>(str.param); - T y_exval = std::get<11>(str.param); - gtint_t ld_inc = std::get<12>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( matrix_vector_unitStride, dgemvEVT, @@ -191,7 +149,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(AOCL_NaN, AOCL_Inf, -AOCL_Inf, 0), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::dgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -216,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(AOCL_NaN, AOCL_Inf, -AOCL_Inf, 0), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::dgemvEVTPrint() + ::gemvEVTPrint() ); @@ -254,7 +212,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::dgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -279,5 +237,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::dgemvEVTPrint() + ::gemvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/dgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/dgemv_generic.cpp index 5ac4e2cc7..7b919b485 100644 --- a/gtestsuite/testsuite/level2/gemv/dgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/dgemv_generic.cpp @@ -104,44 +104,6 @@ TEST_P(dgemvGeneric, FunctionalTest) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test ); } -class dgemvGenericPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + (( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -163,7 +125,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::dgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -186,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(7), gtint_t(3)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::dgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -209,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(2)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::dgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -233,7 +195,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(false, true) // is_memory_test ), - ::dgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -256,5 +218,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::dgemvGenericPrint() + ::gemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/sgemv_evt_testing.cpp b/gtestsuite/testsuite/level2/gemv/sgemv_evt_testing.cpp index 875d048a8..affd3d8f8 100644 --- a/gtestsuite/testsuite/level2/gemv/sgemv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/gemv/sgemv_evt_testing.cpp @@ -115,49 +115,6 @@ TEST_P(sgemvEVT, NaNInfCheck) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test, is_evt_test, a_exval, x_exval, y_exval ); } -class sgemvEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - T a_exval = std::get<9>(str.param); - T x_exval = std::get<10>(str.param); - T y_exval = std::get<11>(str.param); - gtint_t ld_inc = std::get<12>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - return str_name; - } -}; - - INSTANTIATE_TEST_SUITE_P( matrix_vector_unitStride, sgemvEVT, @@ -192,7 +149,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(AOCL_NaN, AOCL_Inf, -AOCL_Inf, 0), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::sgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -217,7 +174,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(AOCL_NaN, AOCL_Inf, -AOCL_Inf, 0), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::sgemvEVTPrint() + ::gemvEVTPrint() ); @@ -255,7 +212,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::sgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -280,5 +237,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::sgemvEVTPrint() + ::gemvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/sgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/sgemv_generic.cpp index 2208218b9..1041926bd 100644 --- a/gtestsuite/testsuite/level2/gemv/sgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/sgemv_generic.cpp @@ -103,43 +103,6 @@ TEST_P(sgemvGeneric, FunctionalTest) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test ); } -class sgemvGenericPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "sgemv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_sgemv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_sgemv"; -#endif - str_name = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + (( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -161,7 +124,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::sgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -184,7 +147,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(7), gtint_t(3)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::sgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -207,7 +170,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::sgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -230,7 +193,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1), gtint_t(252)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::sgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -253,5 +216,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::sgemvGenericPrint() + ::gemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/test_gemv.h b/gtestsuite/testsuite/level2/gemv/test_gemv.h index 7b475a6fd..39e18e6e1 100644 --- a/gtestsuite/testsuite/level2/gemv/test_gemv.h +++ b/gtestsuite/testsuite/level2/gemv/test_gemv.h @@ -137,3 +137,75 @@ void test_gemv( char storage, char transa, char conjx, gtint_t m, gtint_t n, //---------------------------------------------------------- computediff( "y", leny, y, y_ref, incy, thresh, is_evt_test ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class gemvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char transa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + T beta = std::get<6>(str.param); + gtint_t incx = std::get<7>(str.param); + gtint_t incy = std::get<8>(str.param); + gtint_t ld_inc = std::get<9>(str.param); + bool is_memory_test = std::get<10>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "stor_" + sfm; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_conjx_" + conjx; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + 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); + str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); + str_name = str_name + (( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"); + return str_name; + } +}; + +template +class gemvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char transa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + T beta = std::get<6>(str.param); + gtint_t incx = std::get<7>(str.param); + gtint_t incy = std::get<8>(str.param); + T a_exval = std::get<9>(str.param); + T x_exval = std::get<10>(str.param); + T y_exval = std::get<11>(str.param); + gtint_t ld_inc = std::get<12>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "stor_" + sfm; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_conjx_" + conjx; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + 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); + str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); + str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); + str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); + str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); + + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level2/gemv/zgemv_evt_testing.cpp b/gtestsuite/testsuite/level2/gemv/zgemv_evt_testing.cpp index baa32bd63..fc444b281 100644 --- a/gtestsuite/testsuite/level2/gemv/zgemv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/gemv/zgemv_evt_testing.cpp @@ -116,49 +116,6 @@ TEST_P(zgemvEVT, NaNInfCheck) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test, is_evt_test, a_exval, x_exval, y_exval ); } -class zgemvEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - T a_exval = std::get<9>(str.param); - T x_exval = std::get<10>(str.param); - T y_exval = std::get<11>(str.param); - gtint_t ld_inc = std::get<12>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - return str_name; - } -}; - - INSTANTIATE_TEST_SUITE_P( matrix_vector_unitStride, zgemvEVT, @@ -222,7 +179,7 @@ INSTANTIATE_TEST_SUITE_P( T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::zgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -276,7 +233,7 @@ INSTANTIATE_TEST_SUITE_P( T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::zgemvEVTPrint() + ::gemvEVTPrint() ); @@ -328,7 +285,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(0)) // increment to the leading dim of a ), - ::zgemvEVTPrint() + ::gemvEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -367,5 +324,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(T{0.0, 0.0}), // y_exval ::testing::Values(gtint_t(7)) // increment to the leading dim of a ), - ::zgemvEVTPrint() + ::gemvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/gemv/zgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/zgemv_generic.cpp index eafde88b4..8ddf48953 100644 --- a/gtestsuite/testsuite/level2/gemv/zgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/zgemv_generic.cpp @@ -104,44 +104,6 @@ TEST_P(zgemvGeneric, FunctionalTest) test_gemv( storage, transa, conjx, m, n, alpha, lda_inc, incx, beta, incy, thresh, is_memory_test ); } -class zgemvGenericPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char transa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - T beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(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 = str_name + "stor_" + sfm; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_conjx_" + conjx; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_lda_" + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc )); - str_name = str_name + (( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -163,7 +125,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::zgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -186,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(7), gtint_t(3)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::zgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -209,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::zgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -233,7 +195,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(false, true) // is_memory_test ), - ::zgemvGenericPrint() + ::gemvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -257,5 +219,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(false, true) // is_memory_test ), - ::zgemvGenericPrint() + ::gemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/cger_evt.cpp b/gtestsuite/testsuite/level2/ger/cger_evt.cpp index b862d7527..22a337842 100644 --- a/gtestsuite/testsuite/level2/ger/cger_evt.cpp +++ b/gtestsuite/testsuite/level2/ger/cger_evt.cpp @@ -117,57 +117,6 @@ TEST_P(cger_EVT, ExceptionValues) ai, aj, a_exval, xi, x_exval, yi, y_exval, thresh ); } -class cger_EVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); - gtint_t ai = std::get<9>(str.param); - gtint_t aj = std::get<10>(str.param); - T a_exval = std::get<11>(str.param); - gtint_t xi = std::get<12>(str.param); - T x_exval = std::get<13>(str.param); - gtint_t yi = std::get<14>(str.param); - T y_exval = std::get<15>(str.param); - - gtint_t lda = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc ); - -#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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_lda" + std::to_string(lda); - str_name = str_name + "_ai" + std::to_string(ai); - str_name = str_name + "_aj" + std::to_string(aj); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_xi" + std::to_string(xi); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_yi" + std::to_string(yi); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitStride, cger_EVT, @@ -210,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0, 0.0}, T{NaN, NaN}, T{NaN, Inf}, T{Inf, -Inf} ) ), - ::cger_EVTPrint() + ::gerEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -255,5 +204,5 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0, 0.0}, T{NaN, NaN}, T{NaN, Inf}, T{Inf, -Inf} ) ), - ::cger_EVTPrint() + ::gerEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/cger_generic.cpp b/gtestsuite/testsuite/level2/ger/cger_generic.cpp index 999d1afc4..de302dc1f 100644 --- a/gtestsuite/testsuite/level2/ger/cger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/cger_generic.cpp @@ -90,39 +90,6 @@ TEST_P(cgerGenericTest, RandomData) test_ger( storage, conjx, conjy, m, n, alpha, incx, incy, lda_inc, thresh ); } -class cgerGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = 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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - std::string ld_inc_str = ( ld_inc >= 0) ? std::to_string(ld_inc) : "m" + std::to_string(std::abs(ld_inc)); - str_name = str_name + "_lda_inc" + ld_inc_str; - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, cgerGenericTest, @@ -151,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); #ifdef TEST_BLIS_TYPED @@ -186,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -218,7 +185,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(5) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); // @note negativeIncrement tests are resulting in Segmentation Faults when @@ -252,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -284,7 +251,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(2) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); //large values of m and n INSTANTIATE_TEST_SUITE_P( @@ -315,7 +282,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(2) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); //Stride greater than m and n INSTANTIATE_TEST_SUITE_P( @@ -346,6 +313,6 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(20) ) ), - ::cgerGenericTestPrint() + ::gerGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/dger_evt.cpp b/gtestsuite/testsuite/level2/ger/dger_evt.cpp index c0b9c301f..9361a86ea 100644 --- a/gtestsuite/testsuite/level2/ger/dger_evt.cpp +++ b/gtestsuite/testsuite/level2/ger/dger_evt.cpp @@ -116,57 +116,6 @@ TEST_P(dger_EVT, ExceptionValues) ai, aj, a_exval, xi, x_exval, yi, y_exval, thresh ); } -class dger_EVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); - gtint_t ai = std::get<9>(str.param); - gtint_t aj = std::get<10>(str.param); - T a_exval = std::get<11>(str.param); - gtint_t xi = std::get<12>(str.param); - T x_exval = std::get<13>(str.param); - gtint_t yi = std::get<14>(str.param); - T y_exval = std::get<15>(str.param); - - gtint_t lda = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc ); - -#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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_lda" + std::to_string(lda); - str_name = str_name + "_ai" + std::to_string(ai); - str_name = str_name + "_aj" + std::to_string(aj); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_xi" + std::to_string(xi); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_yi" + std::to_string(yi); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitStride, dger_EVT, @@ -209,7 +158,7 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0}, NaN, Inf, -Inf ) ), - ::dger_EVTPrint() + ::gerEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -254,5 +203,5 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0}, NaN, Inf, -Inf ) ), - ::dger_EVTPrint() + ::gerEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/dger_generic.cpp b/gtestsuite/testsuite/level2/ger/dger_generic.cpp index 36b5925d3..dc360229c 100644 --- a/gtestsuite/testsuite/level2/ger/dger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/dger_generic.cpp @@ -90,39 +90,6 @@ TEST_P(dgerGenericTest, RandomData) test_ger( storage, conjx, conjy, m, n, alpha, incx, incy, lda_inc, thresh ); } -class dgerGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = 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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - std::string ld_inc_str = ( ld_inc >= 0) ? std::to_string(ld_inc) : "m" + std::to_string(std::abs(ld_inc)); - str_name = str_name + "_lda_inc" + ld_inc_str; - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, dgerGenericTest, @@ -151,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); #ifdef TEST_BLIS_TYPED @@ -181,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -213,7 +180,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(5) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); // @note negativeIncrement tests are resulting in Segmentation Faults when @@ -247,7 +214,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -279,7 +246,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(2) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); //large size for m and n INSTANTIATE_TEST_SUITE_P( @@ -310,7 +277,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(2) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); //incx and incy are greater than m and n. INSTANTIATE_TEST_SUITE_P( @@ -341,5 +308,5 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(7) ) ), - ::dgerGenericTestPrint() + ::gerGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/sger_evt.cpp b/gtestsuite/testsuite/level2/ger/sger_evt.cpp index 0bcb0d463..fba93ec27 100644 --- a/gtestsuite/testsuite/level2/ger/sger_evt.cpp +++ b/gtestsuite/testsuite/level2/ger/sger_evt.cpp @@ -116,57 +116,6 @@ TEST_P(sger_EVT, ExceptionValues) ai, aj, a_exval, xi, x_exval, yi, y_exval, thresh ); } -class sger_EVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); - gtint_t ai = std::get<9>(str.param); - gtint_t aj = std::get<10>(str.param); - T a_exval = std::get<11>(str.param); - gtint_t xi = std::get<12>(str.param); - T x_exval = std::get<13>(str.param); - gtint_t yi = std::get<14>(str.param); - T y_exval = std::get<15>(str.param); - - gtint_t lda = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc ); - -#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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_lda" + std::to_string(lda); - str_name = str_name + "_ai" + std::to_string(ai); - str_name = str_name + "_aj" + std::to_string(aj); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_xi" + std::to_string(xi); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_yi" + std::to_string(yi); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitStride, sger_EVT, @@ -209,7 +158,7 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0}, NaN, Inf, -Inf ) ), - ::sger_EVTPrint() + ::gerEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -254,5 +203,5 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0}, NaN, Inf, -Inf ) ), - ::sger_EVTPrint() + ::gerEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/sger_generic.cpp b/gtestsuite/testsuite/level2/ger/sger_generic.cpp index 2b79137b9..827d71d7f 100644 --- a/gtestsuite/testsuite/level2/ger/sger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/sger_generic.cpp @@ -90,39 +90,6 @@ TEST_P(sgerGenericTest, RandomData) test_ger( storage, conjx, conjy, m, n, alpha, incx, incy, lda_inc, thresh ); } -class sgerGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = 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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - std::string ld_inc_str = ( ld_inc >= 0) ? std::to_string(ld_inc) : "m" + std::to_string(std::abs(ld_inc)); - str_name = str_name + "_lda_inc" + ld_inc_str; - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, sgerGenericTest, @@ -151,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); #ifdef TEST_BLIS_TYPED @@ -186,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -218,7 +185,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(5) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); // @note negativeIncrement tests are resulting in Segmentation Faults when @@ -252,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -284,7 +251,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); INSTANTIATE_TEST_SUITE_P( largeSize, @@ -314,7 +281,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); INSTANTIATE_TEST_SUITE_P( strideGreaterThanSize, @@ -344,5 +311,5 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(9) ) ), - ::sgerGenericTestPrint() + ::gerGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/test_ger.h b/gtestsuite/testsuite/level2/ger/test_ger.h index 213f44afe..89d844e2b 100644 --- a/gtestsuite/testsuite/level2/ger/test_ger.h +++ b/gtestsuite/testsuite/level2/ger/test_ger.h @@ -118,3 +118,85 @@ void test_ger( char storage, char conjx, char conjy, gtint_t m, gtint_t n, //---------------------------------------------------------- computediff( "A", storage, m, n, a.data(), a_ref.data(), lda, thresh, true ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class gerGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char conjx = std::get<1>(str.param); + char conjy = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t incy = std::get<7>(str.param); + gtint_t ld_inc = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + conjx+conjy; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); + std::string ld_inc_str = ( ld_inc >= 0) ? std::to_string(ld_inc) : "m" + std::to_string(std::abs(ld_inc)); + str_name = str_name + "_lda_inc" + ld_inc_str; + return str_name; + } +}; + +template +class gerEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char conjx = std::get<1>(str.param); + char conjy = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t incy = std::get<7>(str.param); + gtint_t ld_inc = std::get<8>(str.param); + gtint_t ai = std::get<9>(str.param); + gtint_t aj = std::get<10>(str.param); + T a_exval = std::get<11>(str.param); + gtint_t xi = std::get<12>(str.param); + T x_exval = std::get<13>(str.param); + gtint_t yi = std::get<14>(str.param); + T y_exval = std::get<15>(str.param); + + gtint_t lda = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc ); + +#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 = str_name + "_" + sfm; + str_name = str_name + "_" + conjx+conjy; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); + str_name = str_name + "_lda" + std::to_string(lda); + str_name = str_name + "_ai" + std::to_string(ai); + str_name = str_name + "_aj" + std::to_string(aj); + str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); + str_name = str_name + "_xi" + std::to_string(xi); + str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); + str_name = str_name + "_yi" + std::to_string(yi); + str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); + + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/ger/zger_evt.cpp b/gtestsuite/testsuite/level2/ger/zger_evt.cpp index 0d5ceff1d..5fbcad978 100644 --- a/gtestsuite/testsuite/level2/ger/zger_evt.cpp +++ b/gtestsuite/testsuite/level2/ger/zger_evt.cpp @@ -117,57 +117,6 @@ TEST_P(zger_EVT, ExceptionValues) ai, aj, a_exval, xi, x_exval, yi, y_exval, thresh ); } -class zger_EVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - T alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); - gtint_t ai = std::get<9>(str.param); - gtint_t aj = std::get<10>(str.param); - T a_exval = std::get<11>(str.param); - gtint_t xi = std::get<12>(str.param); - T x_exval = std::get<13>(str.param); - gtint_t yi = std::get<14>(str.param); - T y_exval = std::get<15>(str.param); - - gtint_t lda = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ld_inc ); - -#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 = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_lda" + std::to_string(lda); - str_name = str_name + "_ai" + std::to_string(ai); - str_name = str_name + "_aj" + std::to_string(aj); - str_name = str_name + "_a_exval_" + testinghelpers::get_value_string(a_exval); - str_name = str_name + "_xi" + std::to_string(xi); - str_name = str_name + "_x_exval_" + testinghelpers::get_value_string(x_exval); - str_name = str_name + "_yi" + std::to_string(yi); - str_name = str_name + "_y_exval_" + testinghelpers::get_value_string(y_exval); - - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitStride, zger_EVT, @@ -210,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0, 0.0}, T{NaN, NaN}, T{NaN, Inf}, T{Inf, -Inf} ) ), - ::zger_EVTPrint() + ::gerEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -255,5 +204,5 @@ INSTANTIATE_TEST_SUITE_P( // y_exval: extreme value for y. ::testing::Values( T{0.0, 0.0}, T{NaN, NaN}, T{NaN, Inf}, T{Inf, -Inf} ) ), - ::zger_EVTPrint() + ::gerEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/ger/zger_generic.cpp b/gtestsuite/testsuite/level2/ger/zger_generic.cpp index e7f445b80..9e82c7769 100644 --- a/gtestsuite/testsuite/level2/ger/zger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/zger_generic.cpp @@ -90,39 +90,6 @@ TEST_P(zgerGenericTest, RandomData) test_ger( storage, conjx, conjy, m, n, alpha, incx, incy, lda_inc, thresh ); } -class zgerGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zger_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zger"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zger"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + conjx+conjy; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_alpha_" + testinghelpers::get_value_string(alpha); - std::string ld_inc_str = ( ld_inc >= 0) ? std::to_string(ld_inc) : "m" + std::to_string(std::abs(ld_inc)); - str_name = str_name + "_lda_inc" + ld_inc_str; - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, zgerGenericTest, @@ -151,7 +118,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); #ifdef TEST_BLIS_TYPED @@ -186,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -218,7 +185,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(5) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); // @note negativeIncrement tests are resulting in Segmentation Faults when @@ -252,7 +219,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(0) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); #endif @@ -284,7 +251,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); INSTANTIATE_TEST_SUITE_P( largeSize, @@ -314,7 +281,7 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(1) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); INSTANTIATE_TEST_SUITE_P( strideGreaterThanSize, @@ -344,5 +311,5 @@ INSTANTIATE_TEST_SUITE_P( // inc_lda: increment to the leading dim of a ::testing::Values( gtint_t(9) ) ), - ::zgerGenericTestPrint() + ::gerGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp b/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp index 8ae718614..19a81debe 100644 --- a/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp +++ b/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp @@ -98,39 +98,6 @@ TEST_P(chemvTest, RandomData) test_hemv( storage, uploa, conja, conjx, n, alpha, lda_inc, incx, beta, incy, thresh ); } -class chemvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conja = std::get<2>(str.param); - char conjx = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - scomplex beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "chemv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_chemv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_chemv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conja+conjx; - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -151,5 +118,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::chemvTestPrint() + ::hemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/hemv/test_hemv.h b/gtestsuite/testsuite/level2/hemv/test_hemv.h index 9da9769db..b6cdb04d3 100644 --- a/gtestsuite/testsuite/level2/hemv/test_hemv.h +++ b/gtestsuite/testsuite/level2/hemv/test_hemv.h @@ -76,3 +76,33 @@ void test_hemv( char storage, char uploa, char conja, char conjx, gtint_t n, //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class hemvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conja = std::get<2>(str.param); + char conjx = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + T beta = std::get<6>(str.param); + gtint_t incx = std::get<7>(str.param); + gtint_t incy = std::get<8>(str.param); + gtint_t ld_inc = std::get<9>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conja+conjx; + str_name += "_n_" + std::to_string(n); + 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); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp b/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp index 1cfaa217f..5dfbaff51 100644 --- a/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp +++ b/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp @@ -98,39 +98,6 @@ TEST_P(zhemvTest, RandomData) test_hemv( storage, uploa, conja, conjx, n, alpha, lda_inc, incx, beta, incy, thresh ); } -class zhemvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conja = std::get<2>(str.param); - char conjx = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - dcomplex beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zhemv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zhemv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zhemv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conja+conjx; - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -151,5 +118,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::zhemvTestPrint() + ::hemvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/her/cher_generic.cpp b/gtestsuite/testsuite/level2/her/cher_generic.cpp index 008ca1689..06a528fec 100644 --- a/gtestsuite/testsuite/level2/her/cher_generic.cpp +++ b/gtestsuite/testsuite/level2/her/cher_generic.cpp @@ -85,34 +85,6 @@ TEST_P(cherTest, RandomData) test_her( storage, uploa, conjx, n, alpha, incx, lda_inc, thresh ); } -class cherTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - float alpha = std::get<4>(str.param); - gtint_t incx = std::get<5>(str.param); - gtint_t ld_inc = std::get<6>(str.param); -#ifdef TEST_BLAS - std::string str_name = "cher_"; -#elif TEST_CBLAS - std::string str_name = "cblas_cher"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cher"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -130,5 +102,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::cherTestPrint() + ::herGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/her/test_her.h b/gtestsuite/testsuite/level2/her/test_her.h index efffcb9f2..bcf4bf749 100644 --- a/gtestsuite/testsuite/level2/her/test_her.h +++ b/gtestsuite/testsuite/level2/her/test_her.h @@ -73,3 +73,28 @@ void test_her( char storage, char uploa, char conjx, gtint_t n, Tr alpha, //---------------------------------------------------------- computediff( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class herGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + gtint_t n = std::get<3>(str.param); + T alpha = std::get<4>(str.param); + gtint_t incx = std::get<5>(str.param); + gtint_t ld_inc = std::get<6>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conjx; + str_name += "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/her/zher_generic.cpp b/gtestsuite/testsuite/level2/her/zher_generic.cpp index db4297012..d025d7e52 100644 --- a/gtestsuite/testsuite/level2/her/zher_generic.cpp +++ b/gtestsuite/testsuite/level2/her/zher_generic.cpp @@ -85,34 +85,6 @@ TEST_P(zherTest, RandomData) test_her( storage, uploa, conjx, n, alpha, incx, lda_inc, thresh ); } -class zherTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - double alpha = std::get<4>(str.param); - gtint_t incx = std::get<5>(str.param); - gtint_t ld_inc = std::get<6>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zher_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zher"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zher"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -130,5 +102,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of a ), - ::zherTestPrint() + ::herGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/her2/cher2_generic.cpp b/gtestsuite/testsuite/level2/her2/cher2_generic.cpp index 848d41e8a..673c79b08 100644 --- a/gtestsuite/testsuite/level2/her2/cher2_generic.cpp +++ b/gtestsuite/testsuite/level2/her2/cher2_generic.cpp @@ -91,37 +91,6 @@ TEST_P(cher2Test, RandomData) test_her2( storage, uploa, conjx, conjy, n, alpha, incx, incy, lda_inc, thresh ); } -class cher2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - char conjy = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "cher2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_cher2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cher2"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx+conjy; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -141,5 +110,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of a ), - ::cher2TestPrint() + ::her2GenericPrint() ); diff --git a/gtestsuite/testsuite/level2/her2/test_her2.h b/gtestsuite/testsuite/level2/her2/test_her2.h index 36a98adb6..cf7183c50 100644 --- a/gtestsuite/testsuite/level2/her2/test_her2.h +++ b/gtestsuite/testsuite/level2/her2/test_her2.h @@ -76,3 +76,31 @@ void test_her2( char storage, char uploa, char conjx, char conjy, gtint_t n, //---------------------------------------------------------- computediff( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class her2GenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + char conjy = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t incy = std::get<7>(str.param); + gtint_t ld_inc = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conjx+conjy; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/her2/zher2_generic.cpp b/gtestsuite/testsuite/level2/her2/zher2_generic.cpp index d12be1677..d9d62558a 100644 --- a/gtestsuite/testsuite/level2/her2/zher2_generic.cpp +++ b/gtestsuite/testsuite/level2/her2/zher2_generic.cpp @@ -91,37 +91,6 @@ TEST_P(zher2Test, RandomData) test_her2( storage, uploa, conjx, conjy, n, alpha, incx, incy, lda_inc, thresh ); } -class zher2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - char conjy = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zher2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zher2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zher2"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx+conjy; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -141,5 +110,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::zher2TestPrint() + ::her2GenericPrint() ); diff --git a/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp b/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp index 17f2283bc..5674dc943 100644 --- a/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp +++ b/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp @@ -97,39 +97,6 @@ TEST_P(dsymvTest, RandomData) test_symv( storage, uploa, conja, conjx, n, alpha, lda_inc, incx, beta, incy, thresh ); } -class dsymvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conja = std::get<2>(str.param); - char conjx = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - double beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsymv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsymv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsymv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conja+conjx; - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -150,5 +117,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::dsymvTestPrint() + ::symvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp b/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp index e80e14e61..5a612cb16 100644 --- a/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp +++ b/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp @@ -97,39 +97,6 @@ TEST_P(ssymvTest, RandomData) test_symv( storage, uploa, conja, conjx, n, alpha, lda_inc, incx, beta, incy, thresh ); } -class ssymvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conja = std::get<2>(str.param); - char conjx = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - float beta = std::get<6>(str.param); - gtint_t incx = std::get<7>(str.param); - gtint_t incy = std::get<8>(str.param); - gtint_t ld_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssymv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssymv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssymv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conja+conjx; - str_name += "_n_" + std::to_string(n); - 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); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -150,5 +117,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::ssymvTestPrint() + ::symvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/symv/test_symv.h b/gtestsuite/testsuite/level2/symv/test_symv.h index 1efd636f0..fe23fbfa6 100644 --- a/gtestsuite/testsuite/level2/symv/test_symv.h +++ b/gtestsuite/testsuite/level2/symv/test_symv.h @@ -76,3 +76,33 @@ void test_symv( char storage, char uploa, char conja, char conjx, gtint_t n, //---------------------------------------------------------- computediff( "y", n, y.data(), y_ref.data(), incy, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class symvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conja = std::get<2>(str.param); + char conjx = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + T beta = std::get<6>(str.param); + gtint_t incx = std::get<7>(str.param); + gtint_t incy = std::get<8>(str.param); + gtint_t ld_inc = std::get<9>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conja+conjx; + str_name += "_n_" + std::to_string(n); + 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); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/syr/dsyr_generic.cpp b/gtestsuite/testsuite/level2/syr/dsyr_generic.cpp index 09e4c7265..9fb3fe72f 100644 --- a/gtestsuite/testsuite/level2/syr/dsyr_generic.cpp +++ b/gtestsuite/testsuite/level2/syr/dsyr_generic.cpp @@ -84,34 +84,6 @@ TEST_P(dsyrTest, RandomData) test_syr( storage, uploa, conjx, n, alpha, incx, lda_inc, thresh ); } -class dsyrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - double alpha = std::get<4>(str.param); - gtint_t incx = std::get<5>(str.param); - gtint_t ld_inc = std::get<6>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsyr_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsyr"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsyr"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -129,5 +101,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::dsyrTestPrint() + ::syrGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/syr/ssyr_generic.cpp b/gtestsuite/testsuite/level2/syr/ssyr_generic.cpp index 939f3206d..7673e0225 100644 --- a/gtestsuite/testsuite/level2/syr/ssyr_generic.cpp +++ b/gtestsuite/testsuite/level2/syr/ssyr_generic.cpp @@ -84,34 +84,6 @@ TEST_P(ssyrTest, RandomData) test_syr( storage, uploa, conjx, n, alpha, incx, lda_inc, thresh ); } -class ssyrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - float alpha = std::get<4>(str.param); - gtint_t incx = std::get<5>(str.param); - gtint_t ld_inc = std::get<6>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssyr_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssyr"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssyr"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx; - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -129,5 +101,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::ssyrTestPrint() + ::syrGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/syr/test_syr.h b/gtestsuite/testsuite/level2/syr/test_syr.h index 0d6762379..1d177aac3 100644 --- a/gtestsuite/testsuite/level2/syr/test_syr.h +++ b/gtestsuite/testsuite/level2/syr/test_syr.h @@ -73,3 +73,28 @@ void test_syr( char storage, char uploa, char conjx, gtint_t n, T alpha, //---------------------------------------------------------- computediff( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class syrGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + gtint_t n = std::get<3>(str.param); + T alpha = std::get<4>(str.param); + gtint_t incx = std::get<5>(str.param); + gtint_t ld_inc = std::get<6>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conjx; + str_name += "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp b/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp index 7682bbb95..9ae561309 100644 --- a/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp +++ b/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp @@ -90,37 +90,6 @@ TEST_P(dsyr2Test, RandomData) test_syr2( storage, uploa, conjx, conjy, n, alpha, incx, incy, lda_inc, thresh ); } -class dsyr2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - char conjy = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsyr2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsyr2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsyr2"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx+conjy; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -140,5 +109,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::dsyr2TestPrint() + ::syr2GenericPrint() ); diff --git a/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp b/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp index fee8a5762..62a06eb05 100644 --- a/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp +++ b/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp @@ -90,37 +90,6 @@ TEST_P(ssyr2Test, RandomData) test_syr2( storage, uploa, conjx, conjy, n, alpha, incx, incy, lda_inc, thresh ); } -class ssyr2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char conjx = std::get<2>(str.param); - char conjy = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t incy = std::get<7>(str.param); - gtint_t ld_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssyr2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssyr2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssyr2"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+conjx+conjy; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -140,5 +109,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::ssyr2TestPrint() + ::syr2GenericPrint() ); diff --git a/gtestsuite/testsuite/level2/syr2/test_syr2.h b/gtestsuite/testsuite/level2/syr2/test_syr2.h index 636f03d62..8d03f6ada 100644 --- a/gtestsuite/testsuite/level2/syr2/test_syr2.h +++ b/gtestsuite/testsuite/level2/syr2/test_syr2.h @@ -76,3 +76,31 @@ void test_syr2( char storage, char uploa, char conjx, char conjy, gtint_t n, //---------------------------------------------------------- computediff( "A", storage, n, n, a.data(), a_ref.data(), lda, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class syr2GenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char conjx = std::get<2>(str.param); + char conjy = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t incy = std::get<7>(str.param); + gtint_t ld_inc = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+conjx+conjy; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/trmv/ctrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/ctrmv_generic.cpp index fdce73c79..f11bb6b76 100644 --- a/gtestsuite/testsuite/level2/trmv/ctrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/ctrmv_generic.cpp @@ -88,36 +88,6 @@ TEST_P(ctrmvTest, RandomData) test_trmv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class ctrmvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ctrmv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ctrmv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ctrmv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -140,5 +110,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(9)) // increment to the leading dim of a ), - ::ctrmvTestPrint() + ::trmvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trmv/dtrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/dtrmv_generic.cpp index 01aa9dc77..f762e7a64 100644 --- a/gtestsuite/testsuite/level2/trmv/dtrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/dtrmv_generic.cpp @@ -87,36 +87,6 @@ TEST_P(dtrmvTest, RandomData) test_trmv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class dtrmvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dtrmv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dtrmv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dtrmv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -139,5 +109,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::dtrmvTestPrint() + ::trmvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trmv/strmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/strmv_generic.cpp index 593956aa0..18e6b6e00 100644 --- a/gtestsuite/testsuite/level2/trmv/strmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/strmv_generic.cpp @@ -87,36 +87,6 @@ TEST_P(strmvTest, RandomData) test_trmv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class strmvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "strmv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_strmv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_strmv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -139,5 +109,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of a ), - ::strmvTestPrint() + ::trmvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trmv/test_trmv.h b/gtestsuite/testsuite/level2/trmv/test_trmv.h index a86d6cd48..bf214c5e7 100644 --- a/gtestsuite/testsuite/level2/trmv/test_trmv.h +++ b/gtestsuite/testsuite/level2/trmv/test_trmv.h @@ -72,3 +72,30 @@ void test_trmv( char storage, char uploa, char transa, char diaga, gtint_t n, //---------------------------------------------------------- computediff( "x", n, x.data(), x_ref.data(), incx, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trmvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char transa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t ld_inc = std::get<7>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+transa; + str_name = str_name + "_d" + diaga; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/trmv/ztrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/ztrmv_generic.cpp index 6372e41f9..d9b1a8b92 100644 --- a/gtestsuite/testsuite/level2/trmv/ztrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/ztrmv_generic.cpp @@ -88,36 +88,6 @@ TEST_P(ztrmvTest, RandomData) test_trmv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class ztrmvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ztrmv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ztrmv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ztrmv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -140,5 +110,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of a ), - ::ztrmvTestPrint() + ::trmvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/ctrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/ctrsv_generic.cpp index ac0b6f54a..2ced26269 100644 --- a/gtestsuite/testsuite/level2/trsv/ctrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/ctrsv_generic.cpp @@ -88,36 +88,6 @@ TEST_P(ctrsvTest, RandomData) test_trsv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class ctrsvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ctrsv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ctrsv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ctrsv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -140,5 +110,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of a ), - ::ctrsvTestPrint() + ::trsvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/dtrsv_evt_testing.cpp b/gtestsuite/testsuite/level2/trsv/dtrsv_evt_testing.cpp index 8bd64857e..641ee6c5d 100644 --- a/gtestsuite/testsuite/level2/trsv/dtrsv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/trsv/dtrsv_evt_testing.cpp @@ -93,44 +93,6 @@ TEST_P( dtrsvEVT, NaNInfCheck ) test_trsv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh, false, true, xexval, aexval); } -class dtrsvEVTPrint -{ -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - double xexval = std::get<7>(str.param); - double aexval = std::get<8>(str.param); - gtint_t ld_inc = 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 = str_name + "stor_" + sfm; - str_name = str_name + "_uplo_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diaga_" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_ex_x_" + testinghelpers::get_value_string(xexval); - str_name = str_name + "_ex_a_" + testinghelpers::get_value_string(aexval); - str_name = str_name + "_lda_" + std::to_string( - testinghelpers::get_leading_dimension( sfm, transa, n, n, ld_inc ) - ); - return str_name; - } -}; - static double AOCL_NAN = std::numeric_limits::quiet_NaN(); static double AOCL_INF = std::numeric_limits::infinity(); @@ -165,5 +127,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(AOCL_NAN, -AOCL_INF, AOCL_INF, 0), // exception value for A ::testing::Values(gtint_t(0), gtint_t(10)) // increment to the leading dim of a ), - ::dtrsvEVTPrint() + ::trsvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/dtrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/dtrsv_generic.cpp index 689b02a47..0c388f163 100644 --- a/gtestsuite/testsuite/level2/trsv/dtrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/dtrsv_generic.cpp @@ -89,41 +89,6 @@ TEST_P(dtrsvAPI, FunctionalTest) test_trsv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh, is_mem_test); } -class dtrsvPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); - bool is_mem_test = 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 = str_name + "stor_" + sfm; - str_name = str_name + "_uplo_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diaga_" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_lda_" + std::to_string( - testinghelpers::get_leading_dimension( sfm, transa, n, n, ld_inc ) - ); - str_name = str_name + (is_mem_test ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( Native, dtrsvAPI, @@ -159,5 +124,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(10), gtint_t(358)), // increment to the leading dim of a ::testing::Values(false, true) // is memory test ), - ::dtrsvPrint() + ::trsvMemGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/strsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/strsv_generic.cpp index a17b3c402..007a43132 100644 --- a/gtestsuite/testsuite/level2/trsv/strsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/strsv_generic.cpp @@ -87,36 +87,6 @@ TEST_P(strsvTest, RandomData) test_trsv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh ); } -class strsvTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - gtint_t ld_inc = std::get<7>(str.param); -#ifdef TEST_BLAS - std::string str_name = "strsv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_strsv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_strsv"; -#endif - str_name = str_name + "_" + sfm; - str_name = str_name + "_" + uploa+transa; - str_name = str_name + "_d" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_" + std::to_string(ld_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -139,5 +109,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(gtint_t(0), gtint_t(7)) // increment to the leading dim of a ), - ::strsvTestPrint() + ::trsvGenericPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/test_trsv.h b/gtestsuite/testsuite/level2/trsv/test_trsv.h index f73b55118..13666aeb6 100644 --- a/gtestsuite/testsuite/level2/trsv/test_trsv.h +++ b/gtestsuite/testsuite/level2/trsv/test_trsv.h @@ -146,3 +146,96 @@ void test_trsv( //---------------------------------------------------------- computediff( "x", n, x_ptr, x_ref.data(), incx, thresh, is_evt_test ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trsvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char transa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t ld_inc = std::get<7>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm; + str_name = str_name + "_" + uploa+transa; + str_name = str_name + "_d" + diaga; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name = str_name + "_" + std::to_string(ld_inc); + return str_name; + } +}; + +// If strsv also gets modified to include memory testing, delete above and rename this to trsvGenericPrint. +template +class trsvMemGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char transa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + gtint_t ld_inc = std::get<7>(str.param); + bool is_mem_test = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "stor_" + sfm; + str_name = str_name + "_uplo_" + uploa; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_diaga_" + diaga; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name = str_name + "_lda_" + std::to_string( + testinghelpers::get_leading_dimension( sfm, transa, n, n, ld_inc ) + ); + str_name = str_name + (is_mem_test ? "_mem_test_enabled" : "_mem_test_disabled"); + return str_name; + } +}; + +template +class trsvEVTPrint +{ +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uploa = std::get<1>(str.param); + char transa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + gtint_t incx = std::get<6>(str.param); + T xexval = std::get<7>(str.param); + T aexval = std::get<8>(str.param); + gtint_t ld_inc = std::get<9>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "stor_" + sfm; + str_name = str_name + "_uplo_" + uploa; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_diaga_" + diaga; + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name = str_name + "_ex_x_" + testinghelpers::get_value_string(xexval); + str_name = str_name + "_ex_a_" + testinghelpers::get_value_string(aexval); + str_name = str_name + "_lda_" + std::to_string( + testinghelpers::get_leading_dimension( sfm, transa, n, n, ld_inc ) + ); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level2/trsv/ztrsv_evt_testing.cpp b/gtestsuite/testsuite/level2/trsv/ztrsv_evt_testing.cpp index 6e7ff989f..9eaec1572 100644 --- a/gtestsuite/testsuite/level2/trsv/ztrsv_evt_testing.cpp +++ b/gtestsuite/testsuite/level2/trsv/ztrsv_evt_testing.cpp @@ -93,44 +93,6 @@ TEST_P( ztrsvEVT, NaNInfCheck ) test_trsv( storage, uploa, transa, diaga, n, alpha, lda_inc, incx, thresh, false, true, xexval, aexval); } -class ztrsvEVTPrint -{ -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uploa = std::get<1>(str.param); - char transa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - gtint_t incx = std::get<6>(str.param); - dcomplex xexval = std::get<7>(str.param); - dcomplex aexval = std::get<8>(str.param); - gtint_t ld_inc = 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 = str_name + "stor_" + sfm; - str_name = str_name + "_uplo_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diaga_" + diaga; - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_ex_x_" + testinghelpers::get_value_string(xexval); - str_name = str_name + "_ex_a_" + testinghelpers::get_value_string(aexval); - str_name = str_name + "_lda_" + std::to_string( - testinghelpers::get_leading_dimension( sfm, transa, n, n, ld_inc ) - ); - return str_name; - } -}; - static double AOCL_NAN = std::numeric_limits::quiet_NaN(); static double AOCL_INF = std::numeric_limits::infinity(); @@ -182,5 +144,5 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{1, 0}), // exception value for A ::testing::Values(gtint_t(0), gtint_t(10)) // increment to the leading dim of a ), - ::ztrsvEVTPrint() + ::trsvEVTPrint() ); diff --git a/gtestsuite/testsuite/level2/trsv/ztrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/ztrsv_generic.cpp index 79e89e9e1..eff0e334a 100644 --- a/gtestsuite/testsuite/level2/trsv/ztrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/ztrsv_generic.cpp @@ -161,5 +161,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(10), gtint_t(358)), // increment to the leading dim of a ::testing::Values(false, true) // is memory test ), - ::ztrsvPrint() + ::trsvMemGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/cgemm_evt_testing.cpp b/gtestsuite/testsuite/level3/gemm/cgemm_evt_testing.cpp index 1072f30b0..8660bb145 100644 --- a/gtestsuite/testsuite/level3/gemm/cgemm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/gemm/cgemm_evt_testing.cpp @@ -133,67 +133,6 @@ TEST_P(cgemmEVT, NaNInfCheck) alpha, beta, ai, aj, aex, bi, bj, bex, ci, cj, cex, thresh ); } -class cgemmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - gtint_t ai, aj, bi, bj, ci, cj; - T aex, bex, cex; - ai = std::get<6>(str.param); - aj = std::get<7>(str.param); - aex = std::get<8>(str.param); - - bi = std::get<9>(str.param); - bj = std::get<10>(str.param); - bex = std::get<11>(str.param); - - ci = std::get<12>(str.param); - cj = std::get<13>(str.param); - cex = std::get<14>(str.param); - - T alpha = std::get<15>(str.param); - T beta = std::get<16>(str.param); - gtint_t lda_inc = std::get<17>(str.param); - gtint_t ldb_inc = std::get<18>(str.param); - gtint_t ldc_inc = std::get<19>(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 = str_name + "storageOfMatrix_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name = str_name + "_A" + std::to_string(ai) + std::to_string(aj); - str_name = str_name + "_" + testinghelpers::get_value_string(aex); - str_name = str_name + "_B" + std::to_string(bi) + std::to_string(bj); - str_name = str_name + "_" + testinghelpers::get_value_string(bex); - str_name = str_name + "_C" + std::to_string(ci) + std::to_string(cj); - str_name = str_name + "_" + testinghelpers::get_value_string(cex); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - /********************************************************************/ /* Testing ExceptionValue testing for SUP and Native implementation */ /* of cgemm API */ @@ -243,7 +182,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -282,7 +221,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -321,7 +260,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -359,7 +298,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -394,7 +333,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -429,7 +368,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -468,7 +407,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -507,7 +446,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -545,5 +484,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/cgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/cgemm_generic.cpp index fea15e799..136d108d4 100644 --- a/gtestsuite/testsuite/level3/gemm/cgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/cgemm_generic.cpp @@ -96,44 +96,6 @@ TEST_P(cgemmAPI, FunctionalTest) //---------------------------------------------------------- test_gemm( storage, transa, transb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class cgemmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - scomplex alpha = std::get<6>(str.param); - scomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(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 = str_name + "storageOfMatrix_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; /********************************************************************/ /* Testing SUP and Native implementation of cgemm API */ @@ -184,7 +146,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(9185)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4367)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -209,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(9185)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4367)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -232,7 +194,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(9185)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4367)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -259,7 +221,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(7654)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4321)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -282,7 +244,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -309,5 +271,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::cgemmPrint() + ::gemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/dgemm_evt_testing.cpp b/gtestsuite/testsuite/level3/gemm/dgemm_evt_testing.cpp index 258f34526..99c887758 100644 --- a/gtestsuite/testsuite/level3/gemm/dgemm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/gemm/dgemm_evt_testing.cpp @@ -121,73 +121,6 @@ TEST_P(DGEMMEVT, ExceptionValueTest) alpha, beta, ai, aj, aex, bi, bj, bex, ci, cj, cex, thresh ); } -// Helper classes for printing the test case parameters based on the instantiator -// These are mainly used to help with debugging, in case of failures - -// Utility to print the test-case in case of exception value on matrices -class DGEMMEVMatPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - - gtint_t ai = std::get<6>(str.param); - gtint_t aj = std::get<7>(str.param); - double aex = std::get<8>(str.param); - - gtint_t bi = std::get<9>(str.param); - gtint_t bj = std::get<10>(str.param); - double bex = std::get<11>(str.param); - - gtint_t ci = std::get<12>(str.param); - gtint_t cj = std::get<13>(str.param); - double cex = std::get<14>(str.param); - - double alpha = std::get<15>(str.param); - double beta = std::get<16>(str.param); - - gtint_t lda_inc = std::get<17>(str.param); - gtint_t ldb_inc = std::get<18>(str.param); - gtint_t ldc_inc = std::get<19>(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 = str_name + "C_matrix_storage_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name = str_name + "_A" + std::to_string(ai) + std::to_string(aj); - str_name = str_name + "_" + testinghelpers::get_value_string(aex); - str_name = str_name + "_B" + std::to_string(bi) + std::to_string(bj); - str_name = str_name + "_" + testinghelpers::get_value_string(bex); - str_name = str_name + "_C" + std::to_string(ci) + std::to_string(cj); - str_name = str_name + "_" + testinghelpers::get_value_string(cex); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - /* It contains both the exception value testing(EVT) and the positive accuracy testing of the bli_DGEMM_4x4_avx2_k1_nn( ... ) computational @@ -243,7 +176,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); // Testing the fringe cases @@ -277,7 +210,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); // Exception value testing(on alpha and beta) @@ -311,7 +244,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ @@ -348,7 +281,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); /******************************************************/ @@ -385,7 +318,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); /*********************************************************/ @@ -422,7 +355,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ @@ -461,7 +394,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ @@ -499,5 +432,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGEMMEVMatPrint() + ::gemmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/dgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/dgemm_generic.cpp index 181c07833..7e4d422a8 100644 --- a/gtestsuite/testsuite/level3/gemm/dgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/dgemm_generic.cpp @@ -100,42 +100,6 @@ TEST_P(DGEMMTest, RandomData) test_gemm( storage, transa, transb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class DGemmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - double alpha = std::get<6>(str.param); - double beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dgemm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dgemm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dgemm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + tsa + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( expect_dgemm_k1_path, DGEMMTest, @@ -156,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 3), // increment to the leading dim of b ::testing::Values(0, 3) // increment to the leading dim of c ), - ::DGemmTestPrint() + ::gemmGenericPrint() ); //----------------------------- bli_dgemm_tiny kernel ------------------------------------ @@ -180,7 +144,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 3), // increment to the leading dim of b ::testing::Values(0, 3) // increment to the leading dim of c ), - ::DGemmTestPrint() + ::gemmGenericPrint() ); //----------------------------- dgemm_small kernel ------------------------------------ @@ -208,7 +172,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 3), // increment to the leading dim of b ::testing::Values(0, 3) // increment to the leading dim of c ), - ::DGemmTestPrint() + ::gemmGenericPrint() ); // ----------------------------- SUP implementation -------------------------------------- @@ -231,7 +195,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 3), // increment to the leading dim of b ::testing::Values(0, 3) // increment to the leading dim of c ), - ::DGemmTestPrint() + ::gemmGenericPrint() ); // ----------------------------- Native implementation -------------------------------------- @@ -255,5 +219,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 3), // increment to the leading dim of b ::testing::Values(0, 3) // increment to the leading dim of c ), - ::DGemmTestPrint() + ::gemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/dgemm_ovr_undr.cpp b/gtestsuite/testsuite/level3/gemm/dgemm_ovr_undr.cpp index 3896d9bbf..d3581c9d4 100644 --- a/gtestsuite/testsuite/level3/gemm/dgemm_ovr_undr.cpp +++ b/gtestsuite/testsuite/level3/gemm/dgemm_ovr_undr.cpp @@ -115,59 +115,6 @@ TEST_P(DGEMMOvrUndr, OverflowUnderflow) } -class DGEMMOUTestPrint { - public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t over_under = std::get<3>(str.param); - gtint_t input_range = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - gtint_t k = std::get<7>(str.param); - double alpha = std::get<8>(str.param); - double beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); - gtint_t ai = std::get<13>(str.param); - gtint_t aj = std::get<14>(str.param); - gtint_t bi = std::get<15>(str.param); - gtint_t bj = std::get<16>(str.param); - - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - - #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 = str_name + "StorageOfCMatrix_" + sfm; - str_name = str_name + "_transa_" + tsa + "_transb_"+ tsb; - std::string over_under_str = ( over_under > 0) ? "underflow": "overflow"; - str_name = str_name + "_" + over_under_str; - std::string input_range_str = (input_range < 0) ? "within_limit": (input_range > 0) ? "beyond_limit" : "close_to_limit"; - str_name = str_name + "_" + input_range_str; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name = str_name + "_A_" + std::to_string(ai) + "_" + std::to_string(aj); - str_name = str_name + "_B_" + std::to_string(bi) + "_" + std::to_string(bj); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - /* Tests for Overflow @@ -219,7 +166,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(140), // bi ::testing::Values(110) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); /* Overflow test for values close to DBL_MAX */ @@ -253,7 +200,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(140), // bi ::testing::Values(120) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); @@ -288,7 +235,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(145), // bi ::testing::Values(108) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); /* Overflow test for values larger than DBL_MAX */ @@ -322,7 +269,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(130), // bi ::testing::Values(100) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); @@ -378,7 +325,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(140), // bi ::testing::Values(110) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); /* Underflow test for values close to DBL_MIN */ @@ -412,7 +359,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(132), // bi ::testing::Values(110) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); /* Underflow test for values close to DBL_MIN and alpha = 0 */ @@ -446,7 +393,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(88), // bi ::testing::Values(42) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); @@ -482,5 +429,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(100), // bi ::testing::Values(105) // bj ), - ::DGEMMOUTestPrint() + ::gemmOUTPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/sgemm_evt_testing.cpp b/gtestsuite/testsuite/level3/gemm/sgemm_evt_testing.cpp index 93ff2c6e1..f28f45c15 100644 --- a/gtestsuite/testsuite/level3/gemm/sgemm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/gemm/sgemm_evt_testing.cpp @@ -117,66 +117,6 @@ TEST_P(sgemmEVT, NaNInfCheck) test_gemm( storage, transa, transb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, ai, aj, aex, bi, bj, bex, ci, cj, cex, thresh ); } -// Helper classes for printing the test case parameters based on the instantiator -// These are mainly used to help with debugging, in case of failures -// Utility to print the test-case in case of exception value on matrices -class SGEMMEVMatPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - gtint_t ai, aj, bi, bj, ci, cj; - float aex, bex, cex; - ai = std::get<6>(str.param); - aj = std::get<7>(str.param); - aex = std::get<8>(str.param); - bi = std::get<9>(str.param); - bj = std::get<10>(str.param); - bex = std::get<11>(str.param); - ci = std::get<12>(str.param); - cj = std::get<13>(str.param); - cex = std::get<14>(str.param); - float alpha = std::get<15>(str.param); - float beta = std::get<16>(str.param); - gtint_t lda_inc = std::get<17>(str.param); - gtint_t ldb_inc = std::get<18>(str.param); - gtint_t ldc_inc = std::get<19>(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 = str_name + "storageC_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name = str_name + "_A" + std::to_string(ai) + std::to_string(aj); - str_name = str_name + "_" + testinghelpers::get_value_string(aex); - str_name = str_name + "_B" + std::to_string(bi) + std::to_string(bj); - str_name = str_name + "_" + testinghelpers::get_value_string(bex); - str_name = str_name + "_C" + std::to_string(ci) + std::to_string(cj); - str_name = str_name + "_" + testinghelpers::get_value_string(cex); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; /* It contains the exception value testing(EVT). */ @@ -219,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGEMMEVMatPrint() + ::gemmEVTPrint() ); /******************************************************/ /* Testing for SUP code paths */ @@ -255,7 +195,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGEMMEVMatPrint() + ::gemmEVTPrint() ); /*********************************************************/ /* Testing for native code paths */ @@ -291,7 +231,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ /* Testing for small & sup code paths */ @@ -329,7 +269,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ /* Testing for Native code paths */ @@ -366,5 +306,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGEMMEVMatPrint() + ::gemmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/sgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/sgemm_generic.cpp index 0cacae99e..a7728c615 100644 --- a/gtestsuite/testsuite/level3/gemm/sgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/sgemm_generic.cpp @@ -100,45 +100,6 @@ TEST_P(SGemm, FunctionalTest) test_gemm( storage, transa, transb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class SGemmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - float alpha = std::get<6>(str.param); - float beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "sgemm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_sgemm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_sgemm"; -#endif - str_name = str_name + "storageC_" + sfm; - str_name = str_name + "_transA_" + tsa + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( expect_sgemv_path, SGemm, @@ -159,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 15), // increment to the leading dim of b ::testing::Values(0, 17) // increment to the leading dim of c ), - ::SGemmPrint() + ::gemmGenericPrint() ); //----------------------------- sgemm_small kernel ------------------------------------ @@ -184,7 +145,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 15), // increment to the leading dim of b ::testing::Values(0, 17) // increment to the leading dim of c ), - ::SGemmPrint() + ::gemmGenericPrint() ); // ----------------------------- SUP implementation -------------------------------------- @@ -207,7 +168,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 15), // increment to the leading dim of b ::testing::Values(0, 17) // increment to the leading dim of c ), - ::SGemmPrint() + ::gemmGenericPrint() ); // ----------------------------- Native implementation -------------------------------------- @@ -230,5 +191,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 15), // increment to the leading dim of b ::testing::Values(0, 17) // increment to the leading dim of c ), - ::SGemmPrint() + ::gemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/test_gemm.h b/gtestsuite/testsuite/level3/gemm/test_gemm.h index 67aa1ba93..6084b2366 100644 --- a/gtestsuite/testsuite/level3/gemm/test_gemm.h +++ b/gtestsuite/testsuite/level3/gemm/test_gemm.h @@ -244,3 +244,144 @@ void test_gemm( char storage, char trnsa, char trnsb, gtint_t over_under, gtint_ //---------------------------------------------------------- computediff( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh, true ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class gemmGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char tsa = std::get<1>(str.param); + char tsb = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + T beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "storageOfMatrix_" + sfm; + str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); + gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); + gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); + str_name = str_name + "_lda_" + std::to_string(lda); + str_name = str_name + "_ldb_" + std::to_string(ldb); + str_name = str_name + "_ldc_" + std::to_string(ldc); + return str_name; + } +}; + +template +class gemmEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char tsa = std::get<1>(str.param); + char tsb = std::get<2>(str.param); + gtint_t m = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + gtint_t ai, aj, bi, bj, ci, cj; + T aex, bex, cex; + ai = std::get<6>(str.param); + aj = std::get<7>(str.param); + aex = std::get<8>(str.param); + + bi = std::get<9>(str.param); + bj = std::get<10>(str.param); + bex = std::get<11>(str.param); + + ci = std::get<12>(str.param); + cj = std::get<13>(str.param); + cex = std::get<14>(str.param); + + T alpha = std::get<15>(str.param); + T beta = std::get<16>(str.param); + gtint_t lda_inc = std::get<17>(str.param); + gtint_t ldb_inc = std::get<18>(str.param); + gtint_t ldc_inc = std::get<19>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "storageOfMatrix_" + sfm; + str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name = str_name + "_A" + std::to_string(ai) + std::to_string(aj); + str_name = str_name + "_" + testinghelpers::get_value_string(aex); + str_name = str_name + "_B" + std::to_string(bi) + std::to_string(bj); + str_name = str_name + "_" + testinghelpers::get_value_string(bex); + str_name = str_name + "_C" + std::to_string(ci) + std::to_string(cj); + str_name = str_name + "_" + testinghelpers::get_value_string(cex); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); + gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); + gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); + str_name = str_name + "_lda_" + std::to_string(lda); + str_name = str_name + "_ldb_" + std::to_string(ldb); + str_name = str_name + "_ldc_" + std::to_string(ldc); + return str_name; + } +}; + +template +class gemmOUTPrint { + public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char tsa = std::get<1>(str.param); + char tsb = std::get<2>(str.param); + gtint_t over_under = std::get<3>(str.param); + gtint_t input_range = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + gtint_t k = std::get<7>(str.param); + T alpha = std::get<8>(str.param); + T beta = std::get<9>(str.param); + gtint_t lda_inc = std::get<10>(str.param); + gtint_t ldb_inc = std::get<11>(str.param); + gtint_t ldc_inc = std::get<12>(str.param); + gtint_t ai = std::get<13>(str.param); + gtint_t aj = std::get<14>(str.param); + gtint_t bi = std::get<15>(str.param); + gtint_t bj = std::get<16>(str.param); + + gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); + gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); + gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); + + std::string str_name = API_PRINT; + str_name = str_name + "StorageOfCMatrix_" + sfm; + str_name = str_name + "_transa_" + tsa + "_transb_"+ tsb; + std::string over_under_str = ( over_under > 0) ? "underflow": "overflow"; + str_name = str_name + "_" + over_under_str; + std::string input_range_str = (input_range < 0) ? "within_limit": (input_range > 0) ? "beyond_limit" : "close_to_limit"; + str_name = str_name + "_" + input_range_str; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name = str_name + "_A_" + std::to_string(ai) + "_" + std::to_string(aj); + str_name = str_name + "_B_" + std::to_string(bi) + "_" + std::to_string(bj); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_lda_" + std::to_string(lda); + str_name = str_name + "_ldb_" + std::to_string(ldb); + str_name = str_name + "_ldc_" + std::to_string(ldc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/gemm/zgemm_evt_testing.cpp b/gtestsuite/testsuite/level3/gemm/zgemm_evt_testing.cpp index 970b06fe7..a94327b15 100644 --- a/gtestsuite/testsuite/level3/gemm/zgemm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/gemm/zgemm_evt_testing.cpp @@ -126,71 +126,6 @@ TEST_P(ZGEMMEVT, NaNInfCheck) alpha, beta, ai, aj, aex, bi, bj, bex, ci, cj, cex, thresh ); } -// Helper classes for printing the test case parameters based on the instantiator -// These are mainly used to help with debugging, in case of failures - -// Utility to print the test-case in case of exception value on matrices -class ZGEMMEVMatPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - - gtint_t ai = std::get<6>(str.param); - gtint_t aj = std::get<7>(str.param); - T aex = std::get<8>(str.param); - - gtint_t bi = std::get<9>(str.param); - gtint_t bj = std::get<10>(str.param); - T bex = std::get<11>(str.param); - - gtint_t ci = std::get<12>(str.param); - gtint_t cj = std::get<13>(str.param); - T cex = std::get<14>(str.param); - - T alpha = std::get<15>(str.param); - T beta = std::get<16>(str.param); - gtint_t lda_inc = std::get<17>(str.param); - gtint_t ldb_inc = std::get<18>(str.param); - gtint_t ldc_inc = std::get<19>(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 = str_name + "C_matrix_storage_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name = str_name + "_A" + std::to_string(ai) + std::to_string(aj); - str_name = str_name + "_" + testinghelpers::get_value_string(aex); - str_name = str_name + "_B" + std::to_string(bi) + std::to_string(bj); - str_name = str_name + "_" + testinghelpers::get_value_string(bex); - str_name = str_name + "_C" + std::to_string(ci) + std::to_string(cj); - str_name = str_name + "_" + testinghelpers::get_value_string(cex); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - // Exception value testing(on matrices) /* @@ -251,7 +186,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); // Testing the fringe cases @@ -295,7 +230,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); // Exception value testing(on alpha and beta) @@ -331,7 +266,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ @@ -375,7 +310,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); /******************************************************/ @@ -419,7 +354,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); /*********************************************************/ @@ -463,7 +398,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); /********************************************************/ @@ -503,5 +438,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMEVMatPrint() + ::gemmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm/zgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/zgemm_generic.cpp index e63668ce5..4f5c759b1 100644 --- a/gtestsuite/testsuite/level3/gemm/zgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/zgemm_generic.cpp @@ -99,45 +99,6 @@ TEST_P(ZGEMMAPI, FunctionalTest) test_gemm( storage, transa, transb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class ZGEMMPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - gtint_t m = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - dcomplex alpha = std::get<6>(str.param); - dcomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(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 = str_name + "storageC_" + sfm; - str_name = str_name + "_transA_" + tsa + "_transB_" + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, m, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - /********************************************************************/ /* Blas interface testing as per the code sequence */ /* Below API's will be invoked if input condition is satisified */ @@ -173,7 +134,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(120)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(150)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -200,7 +161,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(220)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(250)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -227,7 +188,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(220)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(250)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -254,7 +215,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(200)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(500)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); // Unit testing for bli_zgemm_4x4_avx2_k1_nn kernel @@ -285,7 +246,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(290)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(590)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -308,7 +269,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -335,7 +296,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(940)), // increment to the leading dim of b ::testing::Values(gtint_t(240)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -362,7 +323,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -389,5 +350,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(200)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(500)) // increment to the leading dim of c ), - ::ZGEMMPrint() + ::gemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute_generic.cpp b/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute_generic.cpp index ef5df698d..5897dea8b 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute_generic.cpp @@ -104,46 +104,6 @@ TEST_P(DGemmComputeTest, RandomData) test_gemm_compute( storage, transa, transb, packa, packb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class DGemmComputeTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - char pka = std::get<3>(str.param); - char pkb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - gtint_t k = std::get<7>(str.param); - double alpha = std::get<8>(str.param); - double beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dgemm_compute_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dgemm_compute"; -#else //#elif TEST_BLIS_TYPED - // BLIS interface not yet implemented for pack and compute APIs. - std::string str_name = "blis_dgemm_compute"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + tsa + tsb; - str_name = str_name + "_" + pka + pkb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -167,7 +127,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -192,7 +152,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -217,5 +177,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::DGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute_generic.cpp b/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute_generic.cpp index 7e9604ecd..8fb549a7b 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute_generic.cpp @@ -105,46 +105,6 @@ TEST_P(SGemmComputeTest, RandomData) test_gemm_compute( storage, transa, transb, packa, packb, m, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class SGemmComputeTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - char pka = std::get<3>(str.param); - char pkb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - gtint_t k = std::get<7>(str.param); - float alpha = std::get<8>(str.param); - float beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); -#ifdef TEST_BLAS - std::string str_name = "sgemm_compute_"; -#elif TEST_CBLAS - std::string str_name = "cblas_sgemm_compute"; -#else //#elif TEST_BLIS_TYPED - // BLIS interface not yet implemented for pack and compute APIs. - std::string str_name = "blis_sgemm_compute"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + tsa + tsb; - str_name = str_name + "_" + pka + pkb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -168,7 +128,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -193,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -218,5 +178,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::SGemmComputeTestPrint() + ::gemm_computeGeneticPrint() ); diff --git a/gtestsuite/testsuite/level3/gemm_compute/test_gemm_compute.h b/gtestsuite/testsuite/level3/gemm_compute/test_gemm_compute.h index 3f8f28e75..93de3bbf3 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/test_gemm_compute.h +++ b/gtestsuite/testsuite/level3/gemm_compute/test_gemm_compute.h @@ -77,3 +77,39 @@ void test_gemm_compute( char storage, char trnsa, char trnsb, char pcka, char pc //---------------------------------------------------------- computediff( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class gemm_computeGeneticPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char tsa = std::get<1>(str.param); + char tsb = std::get<2>(str.param); + char pka = std::get<3>(str.param); + char pkb = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + gtint_t k = std::get<7>(str.param); + T alpha = std::get<8>(str.param); + T beta = std::get<9>(str.param); + gtint_t lda_inc = std::get<10>(str.param); + gtint_t ldb_inc = std::get<11>(str.param); + gtint_t ldc_inc = std::get<12>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + tsa + tsb; + str_name = str_name + "_" + pka + pkb; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/gemmt/cgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/cgemmt_generic.cpp index 7c97c804f..c98648b72 100644 --- a/gtestsuite/testsuite/level3/gemmt/cgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/cgemmt_generic.cpp @@ -100,42 +100,6 @@ TEST_P(cgemmtTest, RandomData) test_gemmt( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class cgemmtTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - scomplex alpha = std::get<6>(str.param); - scomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "cgemmt_"; -#elif TEST_CBLAS - std::string str_name = "cblas_cgemmt"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cgemmt"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Disable tests for BLIS_TYPED case due to compiler errors. #ifndef TEST_BLIS_TYPED // Black box testing. @@ -159,6 +123,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(3)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of c ), - ::cgemmtTestPrint() + ::gemmtGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/gemmt/dgemmt_evt_testing.cpp b/gtestsuite/testsuite/level3/gemmt/dgemmt_evt_testing.cpp index 4056b2d74..805389175 100644 --- a/gtestsuite/testsuite/level3/gemmt/dgemmt_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/gemmt/dgemmt_evt_testing.cpp @@ -104,53 +104,6 @@ TEST_P( dgemmtEVT, NaNInfCheck ) alpha, beta, thresh, false, true, aexval, bexval, cexval ); } -class dgemmtEVTPrint -{ -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - double alpha = std::get<6>(str.param); - double beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); - double aexval = std::get<11>(str.param); - double bexval = std::get<12>(str.param); - double cexval = std::get<13>(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 = str_name + "_storage_" + sfm; - str_name = str_name + "_transa_" + tsa; - str_name = str_name + "_transb_" + tsb; - str_name = str_name + "_uploa_" + uplo; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, n, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', n, n, ldc_inc ); - str_name = str_name + "_ex_a_" + testinghelpers::get_value_string(aexval); - str_name = str_name + "_ex_b_" + testinghelpers::get_value_string(bexval); - str_name = str_name + "_ex_c_" + testinghelpers::get_value_string(cexval); - str_name = str_name + "_ldb_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - return str_name; - } -}; - static double AOCL_NAN = std::numeric_limits::quiet_NaN(); static double AOCL_INF = std::numeric_limits::infinity(); @@ -178,6 +131,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0.0, AOCL_NAN, AOCL_INF, -AOCL_INF), // extreme value for B matrix ::testing::Values(0.0, AOCL_NAN, AOCL_INF, -AOCL_INF) // extreme value for B matrix ), - ::dgemmtEVTPrint() + ::gemmtEVTPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/gemmt/dgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/dgemmt_generic.cpp index 2ec67c2e8..df1c3cd90 100644 --- a/gtestsuite/testsuite/level3/gemmt/dgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/dgemmt_generic.cpp @@ -101,48 +101,6 @@ TEST_P(dgemmtAPI, FunctionalTest) test_gemmt( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh, is_mem_test ); } -class dgemmtPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - double alpha = std::get<6>(str.param); - double beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); - bool is_mem_test = std::get<11>(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 = str_name + "_storage_" + sfm; - str_name = str_name + "_transa_" + tsa; - str_name = str_name + "_transb_" + tsb; - str_name = str_name + "_uploa_" + uplo; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, n, k, lda_inc ); - gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); - gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', n, n, ldc_inc ); - str_name = str_name + "_lda_" + std::to_string(lda); - str_name = str_name + "_ldb_" + std::to_string(ldb); - str_name = str_name + "_ldc_" + std::to_string(ldc); - str_name = str_name + (is_mem_test ? "_mem_test_enabled" : "_mem_test_disabled"); - return str_name; - } -}; - #ifndef TEST_BLIS_TYPED INSTANTIATE_TEST_SUITE_P( skinny_fringe_cases, @@ -165,7 +123,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(195)), // increment to the leading dim of c ::testing::Values(true, false) // is memory test ), - ::dgemmtPrint() + ::gemmtMemGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -189,7 +147,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(195)), // increment to the leading dim of c ::testing::Values(true, false) // is memory test ), - ::dgemmtPrint() + ::gemmtMemGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -213,6 +171,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(195)), // increment to the leading dim of c ::testing::Values(true, false) // is memory test ), - ::dgemmtPrint() + ::gemmtMemGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/gemmt/sgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/sgemmt_generic.cpp index f205b135f..a099a5c6b 100644 --- a/gtestsuite/testsuite/level3/gemmt/sgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/sgemmt_generic.cpp @@ -99,42 +99,6 @@ TEST_P(sgemmtTest, RandomData) test_gemmt( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class sgemmtTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char tsa = std::get<1>(str.param); - char tsb = std::get<2>(str.param); - char uplo = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - float alpha = std::get<6>(str.param); - float beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "sgemmt_"; -#elif TEST_CBLAS - std::string str_name = "cblas_sgemmt"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_sgemmt"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + tsa + tsb; - str_name = str_name + "_" + uplo; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Disable tests for BLIS_TYPED case due to compiler errors. #ifndef TEST_BLIS_TYPED // Black box testing. @@ -158,6 +122,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(4)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of c ), - ::sgemmtTestPrint() + ::gemmtGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/gemmt/test_gemmt.h b/gtestsuite/testsuite/level3/gemmt/test_gemmt.h index a20531e08..5de3bbcca 100644 --- a/gtestsuite/testsuite/level3/gemmt/test_gemmt.h +++ b/gtestsuite/testsuite/level3/gemmt/test_gemmt.h @@ -138,3 +138,118 @@ void test_gemmt( char storage, char uplo, char trnsa, char trnsb, gtint_t n, //---------------------------------------------------------- computediff( "C", storage, n, n, c_ptr, c_ref.data(), ldc, thresh, is_evt_test ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class gemmtGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + char tsb = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + T beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + uplo; + str_name = str_name + "_" + tsa + tsb; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; + +template +class gemmtMemGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + char tsb = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + T beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + bool is_mem_test = std::get<11>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_storage_" + sfm; + str_name = str_name + "_transa_" + tsa; + str_name = str_name + "_transb_" + tsb; + str_name = str_name + "_uploa_" + uplo; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, n, k, lda_inc ); + gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); + gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', n, n, ldc_inc ); + str_name = str_name + "_lda_" + std::to_string(lda); + str_name = str_name + "_ldb_" + std::to_string(ldb); + str_name = str_name + "_ldc_" + std::to_string(ldc); + str_name = str_name + (is_mem_test ? "_mem_test_enabled" : "_mem_test_disabled"); + return str_name; + } +}; + +// Test-case logger : Used to print the test-case details based on parameters +template +class gemmtEVTPrint +{ +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + char tsb = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + T beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + T aexval = std::get<11>(str.param); + T bexval = std::get<12>(str.param); + T cexval = std::get<13>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_storage_" + sfm; + str_name = str_name + "_transa_" + tsa; + str_name = str_name + "_transb_" + tsb; + str_name = str_name + "_uploa_" + uplo; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + gtint_t lda = testinghelpers::get_leading_dimension( sfm, tsa, n, k, lda_inc ); + gtint_t ldb = testinghelpers::get_leading_dimension( sfm, tsb, k, n, ldb_inc ); + gtint_t ldc = testinghelpers::get_leading_dimension( sfm, 'n', n, n, ldc_inc ); + str_name = str_name + "_ex_a_" + testinghelpers::get_value_string(aexval); + str_name = str_name + "_ex_b_" + testinghelpers::get_value_string(bexval); + str_name = str_name + "_ex_c_" + testinghelpers::get_value_string(cexval); + str_name = str_name + "_ldb_" + std::to_string(lda); + str_name = str_name + "_ldb_" + std::to_string(ldb); + str_name = str_name + "_ldc_" + std::to_string(ldc); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/gemmt/zgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/zgemmt_generic.cpp index d5a6ba62c..c82d681cb 100644 --- a/gtestsuite/testsuite/level3/gemmt/zgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/zgemmt_generic.cpp @@ -100,42 +100,6 @@ TEST_P(zgemmtTest, RandomData) test_gemmt( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class zgemmtTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - dcomplex alpha = std::get<6>(str.param); - dcomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zgemmt_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zgemmt"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zgemmt"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Disable tests for BLIS_TYPED case due to compiler errors. #ifndef TEST_BLIS_TYPED // Black box testing. @@ -159,6 +123,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(9)) // increment to the leading dim of c ), - ::zgemmtTestPrint() + ::gemmtGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp b/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp index eb15a15ea..a5780dcca 100644 --- a/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp +++ b/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp @@ -105,43 +105,6 @@ TEST_P(chemmTest, RandomData) test_hemm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class chemmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - scomplex beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "chemm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_chemm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_chemm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -164,5 +127,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(3)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of c ), - ::chemmTestPrint() + ::hemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/hemm/test_hemm.h b/gtestsuite/testsuite/level3/hemm/test_hemm.h index fc3aebca4..3f53accd2 100644 --- a/gtestsuite/testsuite/level3/hemm/test_hemm.h +++ b/gtestsuite/testsuite/level3/hemm/test_hemm.h @@ -81,3 +81,37 @@ void test_hemm( char storage, char side, char uplo, char conja, char transb, //---------------------------------------------------------- computediff( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class hemmGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uplo = std::get<2>(str.param); + char conja = std::get<3>(str.param); + char tsb = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T alpha = std::get<7>(str.param); + T beta = std::get<8>(str.param); + gtint_t lda_inc = std::get<9>(str.param); + gtint_t ldb_inc = std::get<10>(str.param); + gtint_t ldc_inc = std::get<11>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + side + uplo; + str_name = str_name + "_" + conja + tsb; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/hemm/zhemm_generic.cpp b/gtestsuite/testsuite/level3/hemm/zhemm_generic.cpp index 5bd88182c..f0baada43 100644 --- a/gtestsuite/testsuite/level3/hemm/zhemm_generic.cpp +++ b/gtestsuite/testsuite/level3/hemm/zhemm_generic.cpp @@ -105,43 +105,6 @@ TEST_P(zhemmTest, RandomData) test_hemm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class zhemmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - dcomplex beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zhemm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zhemm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zhemm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -164,5 +127,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(5)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(6)) // increment to the leading dim of c ), - ::zhemmTestPrint() + ::hemmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp b/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp index b5af4aa9e..f5ad93b1c 100644 --- a/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp +++ b/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp @@ -98,42 +98,6 @@ TEST_P(cher2kTest, RandomData) test_her2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class cher2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - scomplex alpha = std::get<6>(str.param); - float beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "cher2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_cher2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cher2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -155,5 +119,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of c ), - ::cher2kTestPrint() + ::her2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/her2k/test_her2k.h b/gtestsuite/testsuite/level3/her2k/test_her2k.h index b4e878d9b..4b092d74f 100644 --- a/gtestsuite/testsuite/level3/her2k/test_her2k.h +++ b/gtestsuite/testsuite/level3/her2k/test_her2k.h @@ -80,3 +80,36 @@ void test_her2k( char storage, char uplo, char transa, char transb, //---------------------------------------------------------- computediff( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template ::real_type> +class her2kGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + char tsb = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + RT beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + uplo; + str_name = str_name + "_" + tsa + tsb; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp b/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp index 3b661c868..32a0af3df 100644 --- a/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp +++ b/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp @@ -98,42 +98,6 @@ TEST_P(zher2kTest, RandomData) test_her2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class zher2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - dcomplex alpha = std::get<6>(str.param); - double beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zher2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zher2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zher2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -155,5 +119,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of c ), - ::zher2kTestPrint() + ::her2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/herk/cherk_generic.cpp b/gtestsuite/testsuite/level3/herk/cherk_generic.cpp index 0718d8168..90e6b3565 100644 --- a/gtestsuite/testsuite/level3/herk/cherk_generic.cpp +++ b/gtestsuite/testsuite/level3/herk/cherk_generic.cpp @@ -93,39 +93,6 @@ TEST_P(cherkTest, RandomData) test_herk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class cherkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - float beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "cherk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_cherk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cherk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -145,5 +112,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(4)) // increment to the leading dim of b ), - ::cherkTestPrint() + ::herkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/herk/test_herk.h b/gtestsuite/testsuite/level3/herk/test_herk.h index fe9e1be00..e30c0cd87 100644 --- a/gtestsuite/testsuite/level3/herk/test_herk.h +++ b/gtestsuite/testsuite/level3/herk/test_herk.h @@ -78,3 +78,33 @@ void test_herk( char storage, char uplo, char transa, gtint_t n, gtint_t k, //---------------------------------------------------------- computediff( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template ::real_type> +class herkGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + gtint_t n = std::get<3>(str.param); + gtint_t k = std::get<4>(str.param); + RT alpha = std::get<5>(str.param); + RT beta = std::get<6>(str.param); + gtint_t lda_inc = std::get<7>(str.param); + gtint_t ldc_inc = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + uplo; + str_name = str_name + "_" + tsa; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/herk/zherk_generic.cpp b/gtestsuite/testsuite/level3/herk/zherk_generic.cpp index 88a822b2b..3ab8a23e1 100644 --- a/gtestsuite/testsuite/level3/herk/zherk_generic.cpp +++ b/gtestsuite/testsuite/level3/herk/zherk_generic.cpp @@ -93,39 +93,6 @@ TEST_P(zherkTest, RandomData) test_herk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class zherkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - double beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zherk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zherk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zherk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -145,5 +112,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(4)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of c ), - ::zherkTestPrint() + ::herkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/symm/csymm_generic.cpp b/gtestsuite/testsuite/level3/symm/csymm_generic.cpp index d42ed8828..7372952c0 100644 --- a/gtestsuite/testsuite/level3/symm/csymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/csymm_generic.cpp @@ -105,43 +105,6 @@ TEST_P(csymmTest, RandomData) test_symm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class csymmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - scomplex beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "csymm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_csymm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_csymm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -164,5 +127,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4)) // increment to the leading dim of c ), - ::csymmTestPrint() + ::symmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/symm/dsymm_generic.cpp b/gtestsuite/testsuite/level3/symm/dsymm_generic.cpp index 720dcdbaa..a4895b21f 100644 --- a/gtestsuite/testsuite/level3/symm/dsymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/dsymm_generic.cpp @@ -104,43 +104,6 @@ TEST_P(dsymmTest, RandomData) test_symm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class dsymmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - double beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsymm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsymm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsymm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -163,5 +126,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(4)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of c ), - ::dsymmTestPrint() + ::symmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/symm/ssymm_generic.cpp b/gtestsuite/testsuite/level3/symm/ssymm_generic.cpp index 03d184430..18297e17c 100644 --- a/gtestsuite/testsuite/level3/symm/ssymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/ssymm_generic.cpp @@ -104,43 +104,6 @@ TEST_P(ssymmTest, RandomData) test_symm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class ssymmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - float beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssymm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssymm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssymm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -163,5 +126,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(1)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(9)) // increment to the leading dim of c ), - ::ssymmTestPrint() + ::symmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/symm/test_symm.h b/gtestsuite/testsuite/level3/symm/test_symm.h index 772a9cf91..f9e4298ef 100644 --- a/gtestsuite/testsuite/level3/symm/test_symm.h +++ b/gtestsuite/testsuite/level3/symm/test_symm.h @@ -82,3 +82,37 @@ void test_symm( char storage, char side, char uplo, char conja, char transb, //---------------------------------------------------------- computediff( "C", storage, m, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class symmGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uplo = std::get<2>(str.param); + char conja = std::get<3>(str.param); + char tsb = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T alpha = std::get<7>(str.param); + T beta = std::get<8>(str.param); + gtint_t lda_inc = std::get<9>(str.param); + gtint_t ldb_inc = std::get<10>(str.param); + gtint_t ldc_inc = std::get<11>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + side + uplo; + str_name = str_name + "_" + conja + tsb; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp b/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp index e000a779d..5f064f0f1 100644 --- a/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp @@ -105,43 +105,6 @@ TEST_P(zsymmTest, RandomData) test_symm( storage, side, uplo, conja, transb, m, n, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class zsymmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uplo = std::get<2>(str.param); - char conja = std::get<3>(str.param); - char tsb = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - dcomplex beta = std::get<8>(str.param); - gtint_t lda_inc = std::get<9>(str.param); - gtint_t ldb_inc = std::get<10>(str.param); - gtint_t ldc_inc = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zsymm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zsymm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zsymm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uplo; - str_name = str_name + "_" + conja + tsb; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -164,5 +127,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(3)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of c ), - ::zsymmTestPrint() + ::symmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syr2k/csyr2k_generic.cpp b/gtestsuite/testsuite/level3/syr2k/csyr2k_generic.cpp index d625e6ee0..691922d30 100644 --- a/gtestsuite/testsuite/level3/syr2k/csyr2k_generic.cpp +++ b/gtestsuite/testsuite/level3/syr2k/csyr2k_generic.cpp @@ -98,42 +98,6 @@ TEST_P(csyr2kTest, RandomData) test_syr2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class csyr2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - scomplex alpha = std::get<6>(str.param); - scomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "csyr2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_csyr2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_csyr2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -155,5 +119,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(4)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of c ), - ::csyr2kTestPrint() + ::syr2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syr2k/dsyr2k_generic.cpp b/gtestsuite/testsuite/level3/syr2k/dsyr2k_generic.cpp index adb729d8b..b16c59ebe 100644 --- a/gtestsuite/testsuite/level3/syr2k/dsyr2k_generic.cpp +++ b/gtestsuite/testsuite/level3/syr2k/dsyr2k_generic.cpp @@ -97,42 +97,6 @@ TEST_P(dsyr2kTest, RandomData) test_syr2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class dsyr2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - double alpha = std::get<6>(str.param); - double beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsyr2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsyr2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsyr2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -154,5 +118,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(7)) // increment to the leading dim of c ), - ::dsyr2kTestPrint() + ::syr2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syr2k/ssyr2k_generic.cpp b/gtestsuite/testsuite/level3/syr2k/ssyr2k_generic.cpp index e7fa02fb5..b3ebecafb 100644 --- a/gtestsuite/testsuite/level3/syr2k/ssyr2k_generic.cpp +++ b/gtestsuite/testsuite/level3/syr2k/ssyr2k_generic.cpp @@ -97,42 +97,6 @@ TEST_P(ssyr2kTest, RandomData) test_syr2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class ssyr2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - float alpha = std::get<6>(str.param); - float beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssyr2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssyr2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssyr2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -154,5 +118,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(4)) // increment to the leading dim of c ), - ::ssyr2kTestPrint() + ::syr2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syr2k/test_syr2k.h b/gtestsuite/testsuite/level3/syr2k/test_syr2k.h index 730076594..f10c17f83 100644 --- a/gtestsuite/testsuite/level3/syr2k/test_syr2k.h +++ b/gtestsuite/testsuite/level3/syr2k/test_syr2k.h @@ -80,3 +80,36 @@ void test_syr2k( char storage, char uplo, char transa, char transb, gtint_t n, //---------------------------------------------------------- computediff( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class syr2kGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + char tsb = std::get<3>(str.param); + gtint_t n = std::get<4>(str.param); + gtint_t k = std::get<5>(str.param); + T alpha = std::get<6>(str.param); + T beta = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + gtint_t ldc_inc = std::get<10>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + uplo; + str_name = str_name + "_" + tsa + tsb; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/syr2k/zsyr2k_generic.cpp b/gtestsuite/testsuite/level3/syr2k/zsyr2k_generic.cpp index 12cd5d1d6..4ecd2e3ea 100644 --- a/gtestsuite/testsuite/level3/syr2k/zsyr2k_generic.cpp +++ b/gtestsuite/testsuite/level3/syr2k/zsyr2k_generic.cpp @@ -98,42 +98,6 @@ TEST_P(zsyr2kTest, RandomData) test_syr2k( storage, uplo, transa, transb, n, k, lda_inc, ldb_inc, ldc_inc, alpha, beta, thresh ); } -class zsyr2kTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - char tsb = std::get<3>(str.param); - gtint_t n = std::get<4>(str.param); - gtint_t k = std::get<5>(str.param); - dcomplex alpha = std::get<6>(str.param); - dcomplex beta = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - gtint_t ldc_inc = std::get<10>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zsyr2k_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zsyr2k"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zsyr2k"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa + tsb; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -155,5 +119,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(5)), // increment to the leading dim of b ::testing::Values(gtint_t(0), gtint_t(6)) // increment to the leading dim of c ), - ::zsyr2kTestPrint() + ::syr2kGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syrk/csyrk_generic.cpp b/gtestsuite/testsuite/level3/syrk/csyrk_generic.cpp index c2ae4564b..1385079fe 100644 --- a/gtestsuite/testsuite/level3/syrk/csyrk_generic.cpp +++ b/gtestsuite/testsuite/level3/syrk/csyrk_generic.cpp @@ -93,39 +93,6 @@ TEST_P(csyrkTest, RandomData) test_syrk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class csyrkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - scomplex alpha = std::get<5>(str.param); - scomplex beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "csyrk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_csyrk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_csyrk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -145,5 +112,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(3)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(2)) // increment to the leading dim of c ), - ::csyrkTestPrint() + ::syrkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp b/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp index 1c49e9ce5..45eb3557b 100644 --- a/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp +++ b/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp @@ -92,39 +92,6 @@ TEST_P(dsyrkTest, RandomData) test_syrk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class dsyrkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - double alpha = std::get<5>(str.param); - double beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dsyrk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dsyrk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dsyrk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -144,5 +111,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(9)) // increment to the leading dim of c ), - ::dsyrkTestPrint() + ::syrkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syrk/ssyrk_generic.cpp b/gtestsuite/testsuite/level3/syrk/ssyrk_generic.cpp index fb659722b..09d91247c 100644 --- a/gtestsuite/testsuite/level3/syrk/ssyrk_generic.cpp +++ b/gtestsuite/testsuite/level3/syrk/ssyrk_generic.cpp @@ -92,39 +92,6 @@ TEST_P(ssyrkTest, RandomData) test_syrk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class ssyrkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - float alpha = std::get<5>(str.param); - float beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ssyrk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ssyrk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ssyrk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -144,5 +111,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(3)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of c ), - ::ssyrkTestPrint() + ::syrkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/syrk/test_syrk.h b/gtestsuite/testsuite/level3/syrk/test_syrk.h index 4718b6174..5f365af53 100644 --- a/gtestsuite/testsuite/level3/syrk/test_syrk.h +++ b/gtestsuite/testsuite/level3/syrk/test_syrk.h @@ -77,3 +77,33 @@ void test_syrk( char storage, char uplo, char transa, gtint_t n, gtint_t k, //---------------------------------------------------------- computediff( "C", storage, n, n, c.data(), c_ref.data(), ldc, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class syrkGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char uplo = std::get<1>(str.param); + char tsa = std::get<2>(str.param); + gtint_t n = std::get<3>(str.param); + gtint_t k = std::get<4>(str.param); + T alpha = std::get<5>(str.param); + T beta = std::get<6>(str.param); + gtint_t lda_inc = std::get<7>(str.param); + gtint_t ldc_inc = std::get<8>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + uplo; + str_name = str_name + "_" + tsa; + str_name += "_n_" + std::to_string(n); + str_name += "_k_" + std::to_string(k); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/syrk/zsyrk_generic.cpp b/gtestsuite/testsuite/level3/syrk/zsyrk_generic.cpp index 3954b03c0..82a4b07ab 100644 --- a/gtestsuite/testsuite/level3/syrk/zsyrk_generic.cpp +++ b/gtestsuite/testsuite/level3/syrk/zsyrk_generic.cpp @@ -93,39 +93,6 @@ TEST_P(zsyrkTest, RandomData) test_syrk( storage, uplo, transa, n, k, lda_inc, ldc_inc, alpha, beta, thresh ); } -class zsyrkTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char uplo = std::get<1>(str.param); - char tsa = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t k = std::get<4>(str.param); - dcomplex alpha = std::get<5>(str.param); - dcomplex beta = std::get<6>(str.param); - gtint_t lda_inc = std::get<7>(str.param); - gtint_t ldc_inc = std::get<8>(str.param); -#ifdef TEST_BLAS - std::string str_name = "zsyrk_"; -#elif TEST_CBLAS - std::string str_name = "cblas_zsyrk"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_zsyrk"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + uplo; - str_name = str_name + "_" + tsa; - str_name += "_n_" + std::to_string(n); - str_name += "_k_" + std::to_string(k); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -145,5 +112,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(5)) // increment to the leading dim of c ), - ::zsyrkTestPrint() + ::syrkGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trmm/ctrmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/ctrmm_generic.cpp index 61a4fad50..55dc9293f 100644 --- a/gtestsuite/testsuite/level3/trmm/ctrmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/ctrmm_generic.cpp @@ -97,39 +97,6 @@ TEST_P(ctrmmTest, RandomData) test_trmm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class ctrmmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ctrmm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ctrmm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ctrmm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -150,5 +117,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(4)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of b ), - ::ctrmmTestPrint() + ::trmmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp index fefcc6da9..89998c5d4 100644 --- a/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp @@ -96,39 +96,6 @@ TEST_P(dtrmmTest, RandomData) test_trmm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class dtrmmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dtrmm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dtrmm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dtrmm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -149,5 +116,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of b ), - ::dtrmmTestPrint() + ::trmmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp index 213e66aaf..0aeeca28c 100644 --- a/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp @@ -96,39 +96,6 @@ TEST_P(strmmTest, RandomData) test_trmm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class strmmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "strmm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_strmm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_strmm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -149,5 +116,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(4)) // increment to the leading dim of b ), - ::strmmTestPrint() + ::trmmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trmm/test_trmm.h b/gtestsuite/testsuite/level3/trmm/test_trmm.h index 2709000b6..9ea532f57 100644 --- a/gtestsuite/testsuite/level3/trmm/test_trmm.h +++ b/gtestsuite/testsuite/level3/trmm/test_trmm.h @@ -74,3 +74,33 @@ void test_trmm( char storage, char side, char uploa, char transa, char diaga, //---------------------------------------------------------- computediff( "B", storage, m, n, b.data(), b_ref.data(), ldb, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trmmGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char transa = std::get<3>(str.param); + char diaga = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T alpha = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + side + uploa + transa; + str_name = str_name + "_d" + diaga; + 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 + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + return str_name; + } +}; diff --git a/gtestsuite/testsuite/level3/trmm/ztrmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/ztrmm_generic.cpp index e7b7c89b8..7ca93b92d 100644 --- a/gtestsuite/testsuite/level3/trmm/ztrmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/ztrmm_generic.cpp @@ -97,39 +97,6 @@ TEST_P(ztrmmTest, RandomData) test_trmm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class ztrmmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "ztrmm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_ztrmm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_ztrmm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - return str_name; - } -}; - // Black box testing. INSTANTIATE_TEST_SUITE_P( Blackbox, @@ -150,5 +117,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(2)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(1)) // increment to the leading dim of b ), - ::ztrmmTestPrint() + ::trmmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trmm3/ctrmm3_generic.cpp b/gtestsuite/testsuite/level3/trmm3/ctrmm3_generic.cpp index 015413049..8889decf4 100644 --- a/gtestsuite/testsuite/level3/trmm3/ctrmm3_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm3/ctrmm3_generic.cpp @@ -110,38 +110,6 @@ TEST_P(ctrmm3Test, RandomData) test_trmm3( storage, side, uploa, transa, diaga, transb, m, n, alpha, lda_inc, ldb_inc, beta, ldc_inc, thresh ); } -class ctrmm3TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char transb = std::get<4>(str.param); - char diaga = std::get<5>(str.param); - gtint_t m = std::get<6>(str.param); - gtint_t n = std::get<7>(str.param); - scomplex alpha = std::get<8>(str.param); - scomplex beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); - std::string str_name = "bli_ctrmm3"; - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa + transb; - str_name = str_name + "_d" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing. INSTANTIATE_TEST_SUITE_P( @@ -162,6 +130,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ctrmm3TestPrint() + ::trmm3GenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/trmm3/dtrmm3_generic.cpp b/gtestsuite/testsuite/level3/trmm3/dtrmm3_generic.cpp index ae3698835..b4547a426 100644 --- a/gtestsuite/testsuite/level3/trmm3/dtrmm3_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm3/dtrmm3_generic.cpp @@ -109,38 +109,6 @@ TEST_P(dtrmm3Test, RandomData) test_trmm3( storage, side, uploa, transa, diaga, transb, m, n, alpha, lda_inc, ldb_inc, beta, ldc_inc, thresh ); } -class dtrmm3TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char transb = std::get<4>(str.param); - char diaga = std::get<5>(str.param); - gtint_t m = std::get<6>(str.param); - gtint_t n = std::get<7>(str.param); - double alpha = std::get<8>(str.param); - double beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); - std::string str_name = "bli_dtrmm3"; - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa + transb; - str_name = str_name + "_d" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing. INSTANTIATE_TEST_SUITE_P( @@ -161,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::dtrmm3TestPrint() + ::trmm3GenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/trmm3/strmm3_generic.cpp b/gtestsuite/testsuite/level3/trmm3/strmm3_generic.cpp index 214153633..f3866f75a 100644 --- a/gtestsuite/testsuite/level3/trmm3/strmm3_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm3/strmm3_generic.cpp @@ -109,38 +109,6 @@ TEST_P(strmm3Test, RandomData) test_trmm3( storage, side, uploa, transa, diaga, transb, m, n, alpha, lda_inc, ldb_inc, beta, ldc_inc, thresh ); } -class strmm3TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char transb = std::get<4>(str.param); - char diaga = std::get<5>(str.param); - gtint_t m = std::get<6>(str.param); - gtint_t n = std::get<7>(str.param); - float alpha = std::get<8>(str.param); - float beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); - std::string str_name = "bli_strmm3"; - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa + transb; - str_name = str_name + "_d" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing. INSTANTIATE_TEST_SUITE_P( @@ -161,6 +129,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::strmm3TestPrint() + ::trmm3GenericPrint() ); -#endif +#endif \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/trmm3/test_trmm3.h b/gtestsuite/testsuite/level3/trmm3/test_trmm3.h index b7533b01b..469abd6a1 100644 --- a/gtestsuite/testsuite/level3/trmm3/test_trmm3.h +++ b/gtestsuite/testsuite/level3/trmm3/test_trmm3.h @@ -78,3 +78,38 @@ void test_trmm3( char storage, char side, char uploa, char transa, char diaga, //---------------------------------------------------------- computediff( "C", storage, m, n, c.data(), c_ref.data(), ldb, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trmm3GenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char transa = std::get<3>(str.param); + char transb = std::get<4>(str.param); + char diaga = std::get<5>(str.param); + gtint_t m = std::get<6>(str.param); + gtint_t n = std::get<7>(str.param); + T alpha = std::get<8>(str.param); + T beta = std::get<9>(str.param); + gtint_t lda_inc = std::get<10>(str.param); + gtint_t ldb_inc = std::get<11>(str.param); + gtint_t ldc_inc = std::get<12>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_" + sfm+sfm+sfm; + str_name = str_name + "_" + side + uploa + transa + transb; + str_name = str_name + "_d" + diaga; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += "_beta_" + testinghelpers::get_value_string(beta); + str_name = str_name + "_" + std::to_string(lda_inc); + str_name = str_name + "_" + std::to_string(ldb_inc); + str_name = str_name + "_" + std::to_string(ldc_inc); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/trmm3/ztrmm3_generic.cpp b/gtestsuite/testsuite/level3/trmm3/ztrmm3_generic.cpp index bf9a3fc10..bf974154c 100644 --- a/gtestsuite/testsuite/level3/trmm3/ztrmm3_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm3/ztrmm3_generic.cpp @@ -110,38 +110,6 @@ TEST_P(ztrmm3Test, RandomData) test_trmm3( storage, side, uploa, transa, diaga, transb, m, n, alpha, lda_inc, ldb_inc, beta, ldc_inc, thresh ); } -class ztrmm3TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char transb = std::get<4>(str.param); - char diaga = std::get<5>(str.param); - gtint_t m = std::get<6>(str.param); - gtint_t n = std::get<7>(str.param); - dcomplex alpha = std::get<8>(str.param); - dcomplex beta = std::get<9>(str.param); - gtint_t lda_inc = std::get<10>(str.param); - gtint_t ldb_inc = std::get<11>(str.param); - gtint_t ldc_inc = std::get<12>(str.param); - std::string str_name = "bli_ztrmm3"; - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa + transb; - str_name = str_name + "_d" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += "_beta_" + testinghelpers::get_value_string(beta); - str_name = str_name + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(ldc_inc); - return str_name; - } -}; - #ifdef TEST_BLIS_TYPED // Black box testing. INSTANTIATE_TEST_SUITE_P( @@ -162,6 +130,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(gtint_t(0)) // increment to the leading dim of c ), - ::ztrmm3TestPrint() + ::trmm3GenericPrint() ); #endif diff --git a/gtestsuite/testsuite/level3/trsm/ctrsm_evt_testing.cpp b/gtestsuite/testsuite/level3/trsm/ctrsm_evt_testing.cpp index fecf7f0a4..c395cce6d 100644 --- a/gtestsuite/testsuite/level3/trsm/ctrsm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/trsm/ctrsm_evt_testing.cpp @@ -104,49 +104,6 @@ TEST_P(ctrsmEVT, NaNInfCheck) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh, a_init, b_init ); } -class ctrsmEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - EVT_TYPE a_encode = std::get<10>(str.param); - EVT_TYPE b_encode = std::get<11>(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 = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - str_name = str_name + "_a_evt_" + std::to_string(a_encode); - str_name = str_name + "_b_evt_" + std::to_string(b_encode); - return str_name; - } -}; - /** * @brief Test CTRSM for extreme values * Code paths taken for: @@ -179,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P( NEG_INF, NEG_NaN), // EVT test for A ::testing::Values(NO_EVT, NaN, INF, NaN_INF, NEG_INF, NEG_NaN) // EVT test for B ), - ::ctrsmEVTPrint() + ::trsmEVTPrint() ); /** @@ -209,5 +166,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(NO_EVT), // EVT test for A ::testing::Values(NO_EVT) // EVT test for B ), - ::ctrsmEVTPrint() + ::trsmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/ctrsm_generic.cpp b/gtestsuite/testsuite/level3/trsm/ctrsm_generic.cpp index d31440122..0e1ae0c48 100644 --- a/gtestsuite/testsuite/level3/trsm/ctrsm_generic.cpp +++ b/gtestsuite/testsuite/level3/trsm/ctrsm_generic.cpp @@ -97,45 +97,6 @@ TEST_P(ctrsmAPI, FunctionalTest) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class ctrsmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = 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 = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - return str_name; - } -}; - /** * @brief Test CTRSM native path, which starts from size 1001 for BLAS api * and starts from size 0 for BLIS api. @@ -159,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(31)), // increment to the leading dim of a ::testing::Values(gtint_t(45)) // increment to the leading dim of b ), - ::ctrsmPrint() + ::trsmGenericPrint() ); /** @@ -182,7 +143,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(58)), // increment to the leading dim of a ::testing::Values(gtint_t(32)) // increment to the leading dim of b ), - ::ctrsmPrint() + ::trsmGenericPrint() ); /** @@ -203,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(85)), // increment to the leading dim of a ::testing::Values(gtint_t(33)) // increment to the leading dim of b ), - ::ctrsmPrint() + ::trsmGenericPrint() ); /** @@ -229,5 +190,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(45)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(93)) // increment to the leading dim of b ), - ::ctrsmPrint() + ::trsmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/dtrsm_evt_testing.cpp b/gtestsuite/testsuite/level3/trsm/dtrsm_evt_testing.cpp index 993940c97..8d24d0522 100644 --- a/gtestsuite/testsuite/level3/trsm/dtrsm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/trsm/dtrsm_evt_testing.cpp @@ -103,43 +103,6 @@ TEST_P(dtrsmEVTTest, Unit_Tester) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh, a_init, b_init ); } -class dtrsmEVTTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - EVT_TYPE a_encode = std::get<10>(str.param); - EVT_TYPE b_encode = std::get<11>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dtrsm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dtrsm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "blis_dtrsm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - str_name = str_name + "_" + std::to_string(a_encode); - str_name = str_name + "_" + std::to_string(b_encode); - return str_name; - } -}; - /** * @brief Test DTRSM for extreme values * Code paths taken for: @@ -169,5 +132,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(NO_EVT, NaN, INF, NaN_INF, DIAG_NaN, DIAG_INF),// EVT test for A ::testing::Values(NO_EVT, NaN, INF, NaN_INF) // EVT test for B ), - ::dtrsmEVTTestPrint() + ::trsmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/dtrsm_generic.cpp b/gtestsuite/testsuite/level3/trsm/dtrsm_generic.cpp index 0e0b0e520..dd25778b9 100644 --- a/gtestsuite/testsuite/level3/trsm/dtrsm_generic.cpp +++ b/gtestsuite/testsuite/level3/trsm/dtrsm_generic.cpp @@ -96,39 +96,6 @@ TEST_P(dtrsmTest, Accuracy_test) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class dtrsmTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dtrsm_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dtrsm"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "blis_dtrsm"; -#endif - str_name = str_name + "_" + sfm+sfm+sfm; - str_name = str_name + "_" + side + uploa + transa; - str_name = str_name + "_d" + diaga; - 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 + "_" + std::to_string(lda_inc); - str_name = str_name + "_" + std::to_string(ldb_inc); - return str_name; - } -}; - /** * @brief Test DTRSM native path, which starts from size 1500 for BLAS api * and starts from size 0 for BLIS api. @@ -152,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); /** @@ -175,7 +142,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); /** @@ -197,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); /** @@ -221,7 +188,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); /** @@ -243,7 +210,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); /** @@ -269,5 +236,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(5)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(3)) // increment to the leading dim of b ), - ::dtrsmTestPrint() + ::trsmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/strsm_evt_testing.cpp b/gtestsuite/testsuite/level3/trsm/strsm_evt_testing.cpp index 0456afc1b..80c508d3d 100644 --- a/gtestsuite/testsuite/level3/trsm/strsm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/trsm/strsm_evt_testing.cpp @@ -103,49 +103,6 @@ TEST_P(strsmEVT, NaNInfCheck) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh, a_init, b_init ); } -class strsmEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - EVT_TYPE a_encode = std::get<10>(str.param); - EVT_TYPE b_encode = std::get<11>(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 = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - str_name = str_name + "_a_evt_" + std::to_string(a_encode); - str_name = str_name + "_b_evt_" + std::to_string(b_encode); - return str_name; - } -}; - /** * @brief Test STRSM for extreme values * Code paths taken for: @@ -175,7 +132,7 @@ INSTANTIATE_TEST_SUITE_P( NEG_INF, NEG_NaN), // EVT test for A ::testing::Values(NO_EVT, NaN, INF, NaN_INF, NEG_INF, NEG_NaN) // EVT test for B ), - ::strsmEVTPrint() + ::trsmEVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -199,5 +156,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(NO_EVT), // EVT test for A ::testing::Values(NO_EVT) // EVT test for B ), - ::strsmEVTPrint() + ::trsmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/strsm_generic.cpp b/gtestsuite/testsuite/level3/trsm/strsm_generic.cpp index f6088ebf0..063446a1c 100644 --- a/gtestsuite/testsuite/level3/trsm/strsm_generic.cpp +++ b/gtestsuite/testsuite/level3/trsm/strsm_generic.cpp @@ -96,46 +96,6 @@ TEST_P(strsmAPI, FunctionalTest) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class strsmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = 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 = "blis_"; -#endif - str_name = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - return str_name; - } -}; - - /** * @brief Test STRSM native path, which starts from size 1000 for BLAS api * and starts from size 0 for BLIS api. @@ -159,7 +119,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(45)), // increment to the leading dim of a ::testing::Values(gtint_t(38)) // increment to the leading dim of b ), - ::strsmPrint() + ::trsmGenericPrint() ); /** @@ -182,7 +142,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(58)), // increment to the leading dim of a ::testing::Values(gtint_t(31)) // increment to the leading dim of b ), - ::strsmPrint() + ::trsmGenericPrint() ); @@ -204,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(95)), // increment to the leading dim of a ::testing::Values(gtint_t(83)) // increment to the leading dim of b ), - ::strsmPrint() + ::trsmGenericPrint() ); @@ -230,5 +190,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(35)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(39)) // increment to the leading dim of b ), - ::strsmPrint() + ::trsmGenericPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/test_trsm.h b/gtestsuite/testsuite/level3/trsm/test_trsm.h index 9218718fc..1fbda2cda 100644 --- a/gtestsuite/testsuite/level3/trsm/test_trsm.h +++ b/gtestsuite/testsuite/level3/trsm/test_trsm.h @@ -245,3 +245,78 @@ void test_trsm( char storage, char side, char uploa, char transa, char diaga, //---------------------------------------------------------- computediff( "B", storage, m, n, b.data(), b_ref.data(), ldb, thresh, nan_inf_check ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trsmGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char transa = std::get<3>(str.param); + char diaga = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T alpha = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_stor_" + sfm; + str_name = str_name + "_side_" + side; + str_name = str_name + "_uploa_" + uploa; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_diag_" + diaga; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + gtint_t mn; + testinghelpers::set_dim_with_side( side, m, n, &mn ); + str_name = str_name + "_lda_" + + std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); + str_name = str_name + "_ldb_" + + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); + return str_name; + } +}; + +template +class trsmEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char sfm = std::get<0>(str.param); + char side = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char transa = std::get<3>(str.param); + char diaga = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T alpha = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + EVT_TYPE a_encode = std::get<10>(str.param); + EVT_TYPE b_encode = std::get<11>(str.param); + + std::string str_name = API_PRINT; + str_name = str_name + "_stor_" + sfm; + str_name = str_name + "_side_" + side; + str_name = str_name + "_uploa_" + uploa; + str_name = str_name + "_transa_" + transa; + str_name = str_name + "_diag_" + diaga; + str_name += "_m_" + std::to_string(m); + str_name += "_n_" + std::to_string(n); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + gtint_t mn; + testinghelpers::set_dim_with_side( side, m, n, &mn ); + str_name = str_name + "_lda_" + + std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); + str_name = str_name + "_ldb_" + + std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); + str_name = str_name + "_a_evt_" + std::to_string(a_encode); + str_name = str_name + "_b_evt_" + std::to_string(b_encode); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/level3/trsm/ztrsm_evt_testing.cpp b/gtestsuite/testsuite/level3/trsm/ztrsm_evt_testing.cpp index ee26e0b2b..48305a8b4 100644 --- a/gtestsuite/testsuite/level3/trsm/ztrsm_evt_testing.cpp +++ b/gtestsuite/testsuite/level3/trsm/ztrsm_evt_testing.cpp @@ -104,49 +104,6 @@ TEST_P(ztrsmEVT, NaNInfCheck) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh, a_init, b_init ); } -class ztrsmEVTPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - EVT_TYPE a_encode = std::get<10>(str.param); - EVT_TYPE b_encode = std::get<11>(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 = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - str_name = str_name + "_a_evt_" + std::to_string(a_encode); - str_name = str_name + "_b_evt_" + std::to_string(b_encode); - return str_name; - } -}; - /** * @brief Test ZTRSM for extreme values * Code paths taken for: @@ -179,7 +136,7 @@ INSTANTIATE_TEST_SUITE_P( NEG_INF, NEG_NaN), // EVT test for A ::testing::Values(NO_EVT, NaN, INF, NaN_INF, NEG_INF, NEG_NaN) // EVT test for B ), - ::ztrsmEVTPrint() + ::trsmEVTPrint() ); /** @@ -209,5 +166,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(NO_EVT), // EVT test for A ::testing::Values(NO_EVT) // EVT test for B ), - ::ztrsmEVTPrint() + ::trsmEVTPrint() ); diff --git a/gtestsuite/testsuite/level3/trsm/ztrsm_generic.cpp b/gtestsuite/testsuite/level3/trsm/ztrsm_generic.cpp index 51adf4126..69e4f5362 100644 --- a/gtestsuite/testsuite/level3/trsm/ztrsm_generic.cpp +++ b/gtestsuite/testsuite/level3/trsm/ztrsm_generic.cpp @@ -97,45 +97,6 @@ TEST_P(ztrsmAPI, FunctionalTest) test_trsm( storage, side, uploa, transa, diaga, m, n, alpha, lda_inc, ldb_inc, thresh ); } -class ztrsmPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char sfm = std::get<0>(str.param); - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char transa = std::get<3>(str.param); - char diaga = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = 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 = str_name + "_stor_" + sfm; - str_name = str_name + "_side_" + side; - str_name = str_name + "_uploa_" + uploa; - str_name = str_name + "_transa_" + transa; - str_name = str_name + "_diag_" + diaga; - str_name += "_m_" + std::to_string(m); - str_name += "_n_" + std::to_string(n); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - str_name = str_name + "_lda_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, transa, mn, mn, lda_inc )); - str_name = str_name + "_ldb_" + - std::to_string(testinghelpers::get_leading_dimension( sfm, 'n', m, n, ldb_inc )); - return str_name; - } -}; - /** * @brief Test ZTRSM native path, which starts from size 501 for BLAS api * and starts from size 0 for BLIS api. @@ -159,7 +120,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(20)), // increment to the leading dim of a ::testing::Values(gtint_t(33)) // increment to the leading dim of b ), - ::ztrsmPrint() + ::trsmGenericPrint() ); /** @@ -182,7 +143,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(56)), // increment to the leading dim of a ::testing::Values(gtint_t(33)) // increment to the leading dim of b ), - ::ztrsmPrint() + ::trsmGenericPrint() ); /** @@ -203,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(54)), // increment to the leading dim of a ::testing::Values(gtint_t(37)) // increment to the leading dim of b ), - ::ztrsmPrint() + ::trsmGenericPrint() ); /** @@ -229,5 +190,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(0), gtint_t(65)), // increment to the leading dim of a ::testing::Values(gtint_t(0), gtint_t(23)) // increment to the leading dim of b ), - ::ztrsmPrint() + ::trsmGenericPrint() ); diff --git a/gtestsuite/testsuite/ukr/amaxv/damaxv_ukr.cpp b/gtestsuite/testsuite/ukr/amaxv/damaxv_ukr.cpp index 6d950e470..ad074c9cc 100644 --- a/gtestsuite/testsuite/ukr/amaxv/damaxv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/amaxv/damaxv_ukr.cpp @@ -71,24 +71,6 @@ TEST_P( damaxvUkr, AccuracyCheck ) test_amaxv_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class damaxvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_damaxv_zen_int kernel. @@ -134,7 +116,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // incx ::testing::Values(false, true) // is_memory_test ), - ::damaxvUkrPrint() + ::amaxvUKRPrint() ); // Unit testing with non-unit strides. @@ -148,7 +130,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // incx ::testing::Values(false, true) // is_memory_test ), - ::damaxvUkrPrint() + ::amaxvUKRPrint() ); #endif @@ -181,7 +163,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // incx ::testing::Values(false, true) // is_memory_test ), - ::damaxvUkrPrint() + ::amaxvUKRPrint() ); // Unit testing with non-unit strides. @@ -195,6 +177,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // incx ::testing::Values(false, true) // is_memory_test ), - ::damaxvUkrPrint() + ::amaxvUKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/amaxv/samaxv_ukr.cpp b/gtestsuite/testsuite/ukr/amaxv/samaxv_ukr.cpp index 54ba75428..963c813cf 100644 --- a/gtestsuite/testsuite/ukr/amaxv/samaxv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/amaxv/samaxv_ukr.cpp @@ -71,24 +71,6 @@ TEST_P( samaxvUkr, AccuracyCheck ) test_amaxv_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class samaxvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_samaxv_zen_int kernel. @@ -113,7 +95,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // incx ::testing::Values(false, true) // is_memory_test ), - ::samaxvUkrPrint() + ::amaxvUKRPrint() ); // Unit testing with non-unit strides. @@ -127,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // incx ::testing::Values(false, true) // is_memory_test ), - ::samaxvUkrPrint() + ::amaxvUKRPrint() ); #endif @@ -157,7 +139,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // incx ::testing::Values(false, true) // is_memory_test ), - ::samaxvUkrPrint() + ::amaxvUKRPrint() ); // Unit testing with non-unit strides. @@ -171,6 +153,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(5)), // incx ::testing::Values(false, true) // is_memory_test ), - ::samaxvUkrPrint() + ::amaxvUKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/amaxv/test_amaxv_ukr.h b/gtestsuite/testsuite/ukr/amaxv/test_amaxv_ukr.h index 2599cc1e7..ff59f5033 100644 --- a/gtestsuite/testsuite/ukr/amaxv/test_amaxv_ukr.h +++ b/gtestsuite/testsuite/ukr/amaxv/test_amaxv_ukr.h @@ -113,3 +113,22 @@ void test_amaxv_ukr( FT ukr_fp, gtint_t n, gtint_t incx, double thresh, bool is_ //---------------------------------------------------------- computediff( "idx", idx, idx_ref ); } + +// Test-case logger : Used to print the test-case details for unit testing the kernels. +// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed +// with this logger. +template +class amaxvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + gtint_t n = std::get<1>(str.param); + gtint_t incx = std::get<2>(str.param); + bool is_memory_test = std::get<3>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/axpbyv/daxpbyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpbyv/daxpbyv_ukr.cpp index a315c32b0..43c09518d 100644 --- a/gtestsuite/testsuite/ukr/axpbyv/daxpbyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpbyv/daxpbyv_ukr.cpp @@ -110,33 +110,6 @@ TEST_P( daxpbyvUkrTest, AccuracyCheck ) test_axpbyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, beta, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class daxpbyvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - double alpha = std::get<5>(str.param); - double beta = std::get<6>(str.param); - bool is_memory_test = std::get<7>(str.param); - - std::string str_name = "daxpbyv_ukr"; - 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); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_daxpbyv_zen_int10 kernel. @@ -180,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // beta ::testing::Values(false, true) // is_memory_test ), - ::daxpbyvUkrTestPrint() + ((::axpbyvMemUKRPrint())) ); // Unit testing for non unit strides @@ -202,7 +175,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // beta ::testing::Values(false, true) // is_memory_test ), - ::daxpbyvUkrTestPrint() + (::axpbyvMemUKRPrint()) ); /* @@ -234,7 +207,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // beta ::testing::Values(false, true) // is_memory_test ), - ::daxpbyvUkrTestPrint() + (::axpbyvMemUKRPrint()) ); // Unit testing for Non-Unit Stride @@ -256,6 +229,6 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // beta ::testing::Values(false, true) // is_memory_test ), - ::daxpbyvUkrTestPrint() + (::axpbyvMemUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/axpbyv/saxpbyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpbyv/saxpbyv_ukr.cpp index 122983436..d28fba63f 100644 --- a/gtestsuite/testsuite/ukr/axpbyv/saxpbyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpbyv/saxpbyv_ukr.cpp @@ -107,31 +107,6 @@ TEST_P( saxpbyvUkrTest, AccuracyCheck ) test_axpbyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, beta, thresh ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class saxpbyvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - float alpha = std::get<5>(str.param); - float beta = std::get<6>(str.param); - - std::string str_name = "saxpbyv_ukr"; - 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; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) // Unit testing with unit stride INSTANTIATE_TEST_SUITE_P( @@ -146,7 +121,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(float(2.2)), // alpha ::testing::Values(float(-1.8)) // beta ), - ::saxpbyvUkrTestPrint() + (::axpbyvUKRPrint()) ); // Unit testing with unit stride @@ -162,6 +137,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(float(2.2)), // alpha ::testing::Values(float(-1.8)) // beta ), - ::saxpbyvUkrTestPrint() + (::axpbyvUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/axpbyv/test_axpbyv_ukr.h b/gtestsuite/testsuite/ukr/axpbyv/test_axpbyv_ukr.h index 1c1774e68..10859fe73 100644 --- a/gtestsuite/testsuite/ukr/axpbyv/test_axpbyv_ukr.h +++ b/gtestsuite/testsuite/ukr/axpbyv/test_axpbyv_ukr.h @@ -124,3 +124,53 @@ static void test_axpbyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gti //---------------------------------------------------------- computediff( "y", n, y, y_ref, incy, thresh ); } + + +// Test-case logger : Used to print the test-case details for unit testing the kernels. +// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed +// with this logger. +template +class axpbyvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = 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); + T1 alpha = std::get<5>(str.param); + T1 beta = std::get<6>(str.param); + + std::string 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; + } +}; + +template +class axpbyvMemUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = 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); + T1 alpha = std::get<5>(str.param); + T1 beta = std::get<6>(str.param); + bool is_memory_test = std::get<7>(str.param); + + std::string 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); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; diff --git a/gtestsuite/testsuite/ukr/axpbyv/zaxpbyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpbyv/zaxpbyv_ukr.cpp index 6ec2df912..87b585fd8 100644 --- a/gtestsuite/testsuite/ukr/axpbyv/zaxpbyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpbyv/zaxpbyv_ukr.cpp @@ -111,32 +111,6 @@ TEST_P( zaxpbyvUkr, AccuracyCheck ) test_axpbyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, beta, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class zaxpbyvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - dcomplex alpha = std::get<5>(str.param); - dcomplex beta = std::get<6>(str.param); - bool is_memory_test = std::get<7>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += ( conjx == 'n' )? "_noconj_x" : "_conj_x"; - 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); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_zaxpbyv_zen_int kernel. @@ -185,7 +159,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{0.0, 0.0}, dcomplex{2.3, -3.7}), // beta ::testing::Values(false, true) // is_memory_test ), - ::zaxpbyvUkrPrint() + (::axpbyvMemUKRPrint()) ); @@ -211,6 +185,6 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{0.0, 0.0}, dcomplex{2.3, -3.7}), // beta ::testing::Values(false, true) // is_memory_test ), - ::zaxpbyvUkrPrint() + (::axpbyvMemUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/axpyv/daxpyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpyv/daxpyv_ukr.cpp index ece533aff..dac78862a 100644 --- a/gtestsuite/testsuite/ukr/axpyv/daxpyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpyv/daxpyv_ukr.cpp @@ -89,31 +89,6 @@ TEST_P( daxpyvUkrTest, AccuracyCheck ) test_axpyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class daxpyvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - double alpha = std::get<5>(str.param); - bool is_memory_test = std::get<6>(str.param); - - std::string str_name = "daxpyv_ukr"; - 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 += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_daxpyv_zen_int10 kernel. @@ -159,7 +134,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); // Unit testing for non unit strides @@ -178,7 +153,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); /* @@ -207,7 +182,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); // Unit testing for non unit strides @@ -226,7 +201,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); #endif @@ -272,7 +247,7 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); // Unit testing for non unit strides @@ -291,6 +266,6 @@ INSTANTIATE_TEST_SUITE_P( double(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::daxpyvUkrTestPrint() + (::axpyvUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/axpyv/saxpyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpyv/saxpyv_ukr.cpp index 4bbab475f..4c191cc8f 100644 --- a/gtestsuite/testsuite/ukr/axpyv/saxpyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpyv/saxpyv_ukr.cpp @@ -81,30 +81,6 @@ TEST_P( saxpyvUkr, AccuracyCheck ) test_axpyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, threshold, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class saxpyvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - float alpha = std::get<5>(str.param); - bool is_memory_test = std::get<6>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += ( conjx == 'n' )? "_noconj_x" : "_conj_x"; - 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 += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_saxpyv_zen_int10 kernel. @@ -146,7 +122,7 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -165,7 +141,7 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); /* @@ -195,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -214,7 +190,7 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); #endif @@ -254,7 +230,7 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -273,6 +249,6 @@ INSTANTIATE_TEST_SUITE_P( float(0.0)), // alpha ::testing::Values(false, true) // is_memory_test ), - ::saxpyvUkrPrint() + (::axpyvUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/axpyv/test_axpyv_ukr.h b/gtestsuite/testsuite/ukr/axpyv/test_axpyv_ukr.h index 035f2f53d..2c63af38e 100644 --- a/gtestsuite/testsuite/ukr/axpyv/test_axpyv_ukr.h +++ b/gtestsuite/testsuite/ukr/axpyv/test_axpyv_ukr.h @@ -125,3 +125,28 @@ static void test_axpyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gtin computediff( "y", n, y, y_ref, incy, thresh ); } + +// Test-case logger : Used to print the test-case details for unit testing the kernels. +// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed +// with this logger. +template +class axpyvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = 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); + T1 alpha = std::get<5>(str.param); + bool is_memory_test = std::get<6>(str.param); + + std::string 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 += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/axpyv/zaxpyv_ukr.cpp b/gtestsuite/testsuite/ukr/axpyv/zaxpyv_ukr.cpp index 80b8d80d5..42b5e2b25 100644 --- a/gtestsuite/testsuite/ukr/axpyv/zaxpyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/axpyv/zaxpyv_ukr.cpp @@ -91,30 +91,6 @@ TEST_P( zaxpyvUkr, AccuracyCheck ) test_axpyv_ukr( ukr_fp, conj_x, n, incx, incy, alpha, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details for unit testing the kernels. -// NOTE : The kernel name is the prefix in instantiator name, and thus is not printed -// with this logger. -class zaxpyvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - dcomplex alpha = std::get<5>(str.param); - bool is_memory_test = std::get<6>(str.param); - - std::string 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 += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_zaxpyv_zen_int5 kernel. @@ -161,7 +137,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{0.0, 0.0}), // alpha ::testing::Values(false, true) // is_memory_test ), - ::zaxpyvUkrPrint() + (::axpyvUKRPrint()) ); // Unit testing for non unit strides @@ -184,7 +160,7 @@ INSTANTIATE_TEST_SUITE_P( dcomplex{0.0, 0.0}), // alpha ::testing::Values(false, true) // is_memory_test ), - ::zaxpyvUkrPrint() + (::axpyvUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/copyv/dcopyv_ukr.cpp b/gtestsuite/testsuite/ukr/copyv/dcopyv_ukr.cpp index 2e2f62840..35612e685 100644 --- a/gtestsuite/testsuite/ukr/copyv/dcopyv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/copyv/dcopyv_ukr.cpp @@ -71,30 +71,6 @@ TEST_P( dcopyvUkrTest, AccuracyCheck ) test_copyv_ukr( ukr_fp, conjx, n, incx, incy, is_memory_test ); } -// 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 dcopyvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = 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); - bool is_memory_test = std::get<5>(str.param); - - std::string str_name = "dcopyv_ukr"; - str_name += "_n_" + std::to_string(n); - str_name += "_conjx" + std::string(&conjx, 1); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_dcopyv_zen_int kernel. @@ -134,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for y ::testing::Values(false, true) // is_memory_test ), - ::dcopyvUkrTestPrint() + ::copyvUKRPrint() ); // Unit testing with Non-Unit Strides(US), across all loops. @@ -149,6 +125,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3)), // stride size for y ::testing::Values(false, true) // is_memory_test ), - ::dcopyvUkrTestPrint() + ::copyvUKRPrint() ); -#endif +#endif \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/copyv/test_copyv_ukr.h b/gtestsuite/testsuite/ukr/copyv/test_copyv_ukr.h index 89c9a0e79..57f2c382b 100644 --- a/gtestsuite/testsuite/ukr/copyv/test_copyv_ukr.h +++ b/gtestsuite/testsuite/ukr/copyv/test_copyv_ukr.h @@ -123,3 +123,24 @@ static void test_copyv_ukr( FT ukr_fp, char conjx, gtint_t n, gtint_t incx, gtin //---------------------------------------------------------- computediff( "y", n, y, y_ref, incy ); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class copyvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = 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); + bool is_memory_test = std::get<5>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += "_conjx" + std::string(&conjx, 1); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; diff --git a/gtestsuite/testsuite/ukr/dotv/ddotv_ukr.cpp b/gtestsuite/testsuite/ukr/dotv/ddotv_ukr.cpp index e5c372416..7074f486c 100644 --- a/gtestsuite/testsuite/ukr/dotv/ddotv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/dotv/ddotv_ukr.cpp @@ -85,34 +85,6 @@ TEST_P( ddotvUkrTest, FunctionalTest ) test_dotv_ukr( ukr, conjx, conjy, n, incx, incy, thresh, is_memory_test ); } -// 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 ddotvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = std::get<1>(str.param); - char conjy = std::get<2>(str.param); - gtint_t n = std::get<3>(str.param); - gtint_t incx = std::get<4>(str.param); - gtint_t incy = std::get<5>(str.param); - bool is_memory_test = std::get<6>(str.param); - - std::string str_name = "ddotvUkr_"; - str_name += "_n_" + std::to_string(n); - str_name += "conjx_" + std::string(&conjx, 1); - str_name += "conjy_" + std::string(&conjy, 1); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - - return str_name; - } -}; - - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -156,7 +128,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -183,7 +155,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); // Tests for bli_ddotv_zen_int10 (AVX2) kernel. @@ -242,7 +214,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -269,7 +241,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); #endif // ---------------------------------------------- @@ -331,7 +303,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -358,7 +330,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test: enable/disable memory tests ::testing::Values( false, true ) ), - ::ddotvUkrTestPrint() + ::dotvUKRPrint() ); #endif // ---------------------------------------------- diff --git a/gtestsuite/testsuite/ukr/dotv/test_dotv_ukr.h b/gtestsuite/testsuite/ukr/dotv/test_dotv_ukr.h index ea35ca3b8..8efcc6f4f 100644 --- a/gtestsuite/testsuite/ukr/dotv/test_dotv_ukr.h +++ b/gtestsuite/testsuite/ukr/dotv/test_dotv_ukr.h @@ -124,3 +124,28 @@ static void test_dotv_ukr( FT ukr, char conjx, char conjy, gtint_t n, gtint_t in // Compute component-wise error. computediff( "rho", rho, rho_ref, thresh ); } + + +// Test-case logger : Used to print the test-case details based on parameters +template +class dotvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = std::get<1>(str.param); + char conjy = std::get<2>(str.param); + gtint_t n = std::get<3>(str.param); + gtint_t incx = std::get<4>(str.param); + gtint_t incy = std::get<5>(str.param); + bool is_memory_test = std::get<6>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += "conjx_" + std::string(&conjx, 1); + str_name += "conjy_" + std::string(&conjy, 1); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/nrm2/dnrm2_ukr.cpp b/gtestsuite/testsuite/ukr/nrm2/dnrm2_ukr.cpp index 25adbb6dc..e44f5230f 100644 --- a/gtestsuite/testsuite/ukr/nrm2/dnrm2_ukr.cpp +++ b/gtestsuite/testsuite/ukr/nrm2/dnrm2_ukr.cpp @@ -69,22 +69,6 @@ TEST_P( dnrm2Ukr, AccuracyCheck ) test_nrm2_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Prints the test case combination -class dnrm2UkrPrint { -public: - std::string operator()( - testing::TestParamInfo, gtint_t, gtint_t, bool>> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_dnorm2fv_unb_var1_avx2 kernel. @@ -114,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::dnrm2UkrPrint() + ::nrm2UKRPrint() ); // Unit testing with non-unit strides. @@ -132,6 +116,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(5)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::dnrm2UkrPrint() + ::nrm2UKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/nrm2/dznrm2_ukr.cpp b/gtestsuite/testsuite/ukr/nrm2/dznrm2_ukr.cpp index f702834c9..11bf99d18 100644 --- a/gtestsuite/testsuite/ukr/nrm2/dznrm2_ukr.cpp +++ b/gtestsuite/testsuite/ukr/nrm2/dznrm2_ukr.cpp @@ -69,22 +69,6 @@ TEST_P( dznrm2UkrTest, AccuracyCheck ) test_nrm2_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Prints the test case combination -class dznrm2Ukr { -public: - std::string operator()( - testing::TestParamInfo, gtint_t, gtint_t, bool>> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_dznorm2fv_unb_var1_avx2 kernel. @@ -114,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::dznrm2Ukr() + ::nrm2UKRPrint() ); // Unit testing with non-unit strides. @@ -132,6 +116,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(5)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::dznrm2Ukr() + ::nrm2UKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/nrm2/scnrm2_ukr.cpp b/gtestsuite/testsuite/ukr/nrm2/scnrm2_ukr.cpp index 2eac06800..a1a2413db 100644 --- a/gtestsuite/testsuite/ukr/nrm2/scnrm2_ukr.cpp +++ b/gtestsuite/testsuite/ukr/nrm2/scnrm2_ukr.cpp @@ -69,22 +69,6 @@ TEST_P( scnrm2Ukr, AccuracyCheck ) test_nrm2_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Prints the test case combination -class scnrm2UkrPrint { -public: - std::string operator()( - testing::TestParamInfo, gtint_t, gtint_t, bool>> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_scnorm2fv_unb_var1_avx2 kernel. @@ -115,7 +99,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::scnrm2UkrPrint() + ::nrm2UKRPrint() ); // Unit testing with non-unit strides. @@ -133,6 +117,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(5)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::scnrm2UkrPrint() + ::nrm2UKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/nrm2/snrm2_ukr.cpp b/gtestsuite/testsuite/ukr/nrm2/snrm2_ukr.cpp index 52c41e1c2..30ff71943 100644 --- a/gtestsuite/testsuite/ukr/nrm2/snrm2_ukr.cpp +++ b/gtestsuite/testsuite/ukr/nrm2/snrm2_ukr.cpp @@ -69,22 +69,6 @@ TEST_P( snrm2Ukr, AccuracyCheck ) test_nrm2_ukr( ukr_fp, n, incx, thresh, is_memory_test ); } -// Prints the test case combination -class snrm2UkrPrint { -public: - std::string operator()( - testing::TestParamInfo, gtint_t, gtint_t, bool>> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - bool is_memory_test = std::get<3>(str.param); - - std::string str_name = "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) /* Unit testing for functionality of bli_snorm2fv_unb_var1_avx2 kernel. @@ -115,7 +99,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(1)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::snrm2UkrPrint() + ::nrm2UKRPrint() ); // Unit testing with non-unit strides. @@ -133,6 +117,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(gtint_t(3), gtint_t(5)), // stride size for x ::testing::Values(true, false) // is_memory_test ), - ::snrm2UkrPrint() + ::nrm2UKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/nrm2/test_nrm2_ukr.h b/gtestsuite/testsuite/ukr/nrm2/test_nrm2_ukr.h index 1c99f6592..c917dd76b 100644 --- a/gtestsuite/testsuite/ukr/nrm2/test_nrm2_ukr.h +++ b/gtestsuite/testsuite/ukr/nrm2/test_nrm2_ukr.h @@ -118,3 +118,20 @@ static void test_nrm2_ukr( nrm2_ker_ft ukr_fp, gtint_t n, gtint_t incx, d computediff( "norm", norm, norm_ref, thresh ); } + +// Test-case logger : Used to print the test-case details based on parameters +template ::real_type> +class nrm2UKRPrint { +public: + std::string operator()( + testing::TestParamInfo, gtint_t, gtint_t, bool>> str) const { + gtint_t n = std::get<1>(str.param); + gtint_t incx = std::get<2>(str.param); + bool is_memory_test = std::get<3>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/scalv/dscalv_ukr.cpp b/gtestsuite/testsuite/ukr/scalv/dscalv_ukr.cpp index 5b58aeae5..b4b32d09e 100644 --- a/gtestsuite/testsuite/ukr/scalv/dscalv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/scalv/dscalv_ukr.cpp @@ -83,29 +83,6 @@ TEST_P( dscalvUkrTest, FunctionalTest ) test_scalv_ukr( ukr, conj_alpha, n, incx, alpha, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details. -class dscalvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = std::get<1>(str.param); - gtint_t n = std::get<2>(str.param); - gtint_t incx = std::get<3>(str.param); - double alpha = std::get<4>(str.param); - bool is_memory_test = std::get<5>(str.param); - - std::string str_name = "d"; - 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); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - - return str_name; - } -}; - - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -145,7 +122,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -174,7 +151,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); // Tests for bli_dscalv_zen_int10 (AVX2) kernel. @@ -235,7 +212,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -261,7 +238,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); #endif // ---------------------------------------------- @@ -343,7 +320,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -369,7 +346,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::dscalvUkrTestPrint() + (::scalvUKRPrint()) ); #endif // ---------------------------------------------- diff --git a/gtestsuite/testsuite/ukr/scalv/test_scalv_ukr.h b/gtestsuite/testsuite/ukr/scalv/test_scalv_ukr.h index 95c889e31..6b8cc3031 100644 --- a/gtestsuite/testsuite/ukr/scalv/test_scalv_ukr.h +++ b/gtestsuite/testsuite/ukr/scalv/test_scalv_ukr.h @@ -115,3 +115,26 @@ static void test_scalv_ukr( FT ukr, char conja_alpha, gtint_t n, gtint_t incx, // Compute component-wise error. computediff( "x", n, x, x_ref, incx, thresh ); } + + +// Test-case logger : Used to print the test-case details based on parameters +template +class scalvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + char conjx = std::get<1>(str.param); + gtint_t n = std::get<2>(str.param); + gtint_t incx = std::get<3>(str.param); + T1 alpha = std::get<4>(str.param); + bool is_memory_test = std::get<5>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += (conjx == 'n') ? "_noconjalpha" : "_conjalpha"; + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_alpha_" + testinghelpers::get_value_string(alpha); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + + return str_name; + } +}; diff --git a/gtestsuite/testsuite/ukr/scalv/zdscalv_ukr.cpp b/gtestsuite/testsuite/ukr/scalv/zdscalv_ukr.cpp index 9768f96ed..6dced7f1f 100644 --- a/gtestsuite/testsuite/ukr/scalv/zdscalv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/scalv/zdscalv_ukr.cpp @@ -87,32 +87,6 @@ TEST_P( zdscalvUkrTest, FunctionalTest ) test_scalv_ukr( ukr, conj_alpha, n, incx, alpha, thresh, is_memory_test ); } -// 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 zdscalvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = std::get<1>(str.param); - gtint_t n = std::get<2>(str.param); - gtint_t incx = std::get<3>(str.param); - dcomplex alpha = std::get<4>(str.param); - bool is_memory_test = std::get<5>(str.param); - - std::string str_name = "zd"; - str_name += "_n_" + std::to_string(n); - str_name += (conjx == 'n') ? "_noconjalpha" : "_conjalpha"; - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_alpha_" + testinghelpers::get_value_string(alpha); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - - return str_name; - } -}; - - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -166,7 +140,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zdscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -197,7 +171,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zdscalvUkrTestPrint() + (::scalvUKRPrint()) ); #endif // ---------------------------------------------- @@ -251,7 +225,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zdscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -282,7 +256,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zdscalvUkrTestPrint() + (::scalvUKRPrint()) ); #endif // ---------------------------------------------- diff --git a/gtestsuite/testsuite/ukr/scalv/zscalv_ukr.cpp b/gtestsuite/testsuite/ukr/scalv/zscalv_ukr.cpp index 1a31ad19d..7d89c9f9b 100644 --- a/gtestsuite/testsuite/ukr/scalv/zscalv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/scalv/zscalv_ukr.cpp @@ -86,29 +86,6 @@ TEST_P( zscalvUkrTest, FunctionalTest ) test_scalv_ukr( ukr, conj_alpha, n, incx, alpha, thresh, is_memory_test ); } -// Test-case logger : Used to print the test-case details. -class zscalvUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - char conjx = std::get<1>(str.param); - gtint_t n = std::get<2>(str.param); - gtint_t incx = std::get<3>(str.param); - dcomplex alpha = std::get<4>(str.param); - bool is_memory_test = std::get<5>(str.param); - - std::string str_name = "z"; - 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); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - - return str_name; - } -}; - - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -149,7 +126,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zscalvUkrTestPrint() + (::scalvUKRPrint()) ); INSTANTIATE_TEST_SUITE_P( @@ -175,7 +152,7 @@ INSTANTIATE_TEST_SUITE_P( ), ::testing::Values(false, true) // is_memory_test ), - ::zscalvUkrTestPrint() + (::scalvUKRPrint()) ); #endif // ---------------------------------------------- diff --git a/gtestsuite/testsuite/ukr/swapv/dswapv_ukr.cpp b/gtestsuite/testsuite/ukr/swapv/dswapv_ukr.cpp index 99e4999e5..18676ea34 100644 --- a/gtestsuite/testsuite/ukr/swapv/dswapv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/swapv/dswapv_ukr.cpp @@ -69,31 +69,6 @@ TEST_P( dswapvUkr, FunctionalTest ) test_swapv_ukr( ukr, n, incx, incy, is_memory_test ); } -// Prints the test case combination -class dswapvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - gtint_t incy = std::get<3>(str.param); - bool is_memory_test = 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 += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -127,7 +102,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test ::testing::Values(false, true) ), - ::dswapvUkrPrint() + ::swapvUKRPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -152,6 +127,6 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test ::testing::Values(false, true) ), - ::dswapvUkrPrint() + ::swapvUKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/swapv/sswapv_ukr.cpp b/gtestsuite/testsuite/ukr/swapv/sswapv_ukr.cpp index a53b94cea..474b877d3 100644 --- a/gtestsuite/testsuite/ukr/swapv/sswapv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/swapv/sswapv_ukr.cpp @@ -72,31 +72,6 @@ TEST_P( sswapvUkr, FunctionalTest ) test_swapv_ukr( ukr, n, incx, incy, is_memory_test ); } -// Prints the test case combination -class sswapvUkrPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - gtint_t n = std::get<1>(str.param); - gtint_t incx = std::get<2>(str.param); - gtint_t incy = std::get<3>(str.param); - bool is_memory_test = 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 += "_incx_" + testinghelpers::get_value_string(incx); - str_name += "_incy_" + testinghelpers::get_value_string(incy); - str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; - return str_name; - } -}; - // ---------------------------------------------- // ----- Begin ZEN1/2/3 (AVX2) Kernel Tests ----- // ---------------------------------------------- @@ -130,7 +105,7 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test ::testing::Values(false, true) ), - ::sswapvUkrPrint() + ::swapvUKRPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -155,6 +130,6 @@ INSTANTIATE_TEST_SUITE_P( // is_memory_test ::testing::Values(false, true) ), - ::sswapvUkrPrint() + ::swapvUKRPrint() ); #endif diff --git a/gtestsuite/testsuite/ukr/swapv/test_swapv_ukr.h b/gtestsuite/testsuite/ukr/swapv/test_swapv_ukr.h index e0de13117..4f7220c38 100644 --- a/gtestsuite/testsuite/ukr/swapv/test_swapv_ukr.h +++ b/gtestsuite/testsuite/ukr/swapv/test_swapv_ukr.h @@ -114,3 +114,23 @@ static void test_swapv_ukr( FT ukr, gtint_t n, gtint_t incx, gtint_t incy, computediff( n, x, x_ref, y, y_ref, incx, incy, false ); } + + +// Test-case logger : Used to print the test-case details based on parameters +template +class swapvUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + gtint_t n = std::get<1>(str.param); + gtint_t incx = std::get<2>(str.param); + gtint_t incy = std::get<3>(str.param); + bool is_memory_test = std::get<4>(str.param); + + std::string str_name = "_n_" + std::to_string(n); + str_name += "_incx_" + testinghelpers::get_value_string(incx); + str_name += "_incy_" + testinghelpers::get_value_string(incy); + str_name += ( is_memory_test ) ? "_mem_test_enabled" : "_mem_test_disabled"; + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/trsm/ctrsm_ukr.cpp b/gtestsuite/testsuite/ukr/trsm/ctrsm_ukr.cpp index 795aa2a29..52e8534e9 100644 --- a/gtestsuite/testsuite/ukr/trsm/ctrsm_ukr.cpp +++ b/gtestsuite/testsuite/ukr/trsm/ctrsm_ukr.cpp @@ -83,39 +83,6 @@ TEST_P(ctrsmUkrSmall, AccuracyCheck) test_trsm_small_ukr( ukr_fp, side, uploa, diaga, transa, m, n, alpha, lda, ldb, thresh, is_memory_test, BLIS_SCOMPLEX); } -class ctrsmSmallUKRPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - char transa = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - scomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(str.param); - std::string res = - std::string("_side_") + side - + "_diag_" + diaga - + "_uplo_" + uploa - + "_trana_" + transa - + "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - res += "_lda_" + std::to_string( lda_inc + mn); - res += "_ldb_" + std::to_string( ldb_inc + m) - + "_m_" + std::to_string(m) - + "_n_" + std::to_string(n); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - - #if defined(BLIS_KERNELS_ZEN) && defined(GTEST_AVX2FMA3) INSTANTIATE_TEST_SUITE_P ( bli_trsm_small, @@ -136,6 +103,6 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 10, 194), // ldb_inc ::testing::Values(false, true) // is_memory_test ), - ::ctrsmSmallUKRPrint() + (::trsmSmallUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/trsm/dtrsm_ukr.cpp b/gtestsuite/testsuite/ukr/trsm/dtrsm_ukr.cpp index d4f5a9b61..5f62ebdf7 100644 --- a/gtestsuite/testsuite/ukr/trsm/dtrsm_ukr.cpp +++ b/gtestsuite/testsuite/ukr/trsm/dtrsm_ukr.cpp @@ -122,59 +122,6 @@ TEST_P(DTRSMSmallUkrTest, small_kernel) test_trsm_small_ukr( ukr_fp, side, uploa, diaga, transa, m, n, alpha, lda, ldb, thresh, is_memory_test, BLIS_DOUBLE); } -class DTRSMUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char storage = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t k = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - gtint_t ldc = std::get<8>(str.param); - bool is_memory_test = std::get<9>(str.param); - std::string res = std::string("dgemmtrsm_ukr") - + "_stor_" + storage - + "_diag_" + diaga - + "_uplo_" + uploa - + "_k_" + std::to_string(k) - + "_alpha_" + testinghelpers::get_value_string(alpha) - + "_ldc_" + std::to_string(ldc); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - -class DTRSMSmallUkrTestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - char transa = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - double alpha = std::get<7>(str.param); - gtint_t lda = std::get<8>(str.param); - gtint_t ldb = std::get<9>(str.param); - bool is_memory_test = std::get<10>(str.param); - std::string res = std::string("trsm_small_") - + "_stor_" + side - + "_diag_" + diaga - + "_uplo_" + uploa - + "_trana_" + transa - + "_alpha_" + testinghelpers::get_value_string(alpha) - + "_lda_" + std::to_string(lda) - + "_ldb_" + std::to_string(ldb) - + "_m_" + std::to_string(m) - + "_n_" + std::to_string(n); - return is_memory_test ? res + "_memory_test" : res; - } -}; - #if defined(BLIS_KERNELS_ZEN4) && defined(GTEST_AVX512) INSTANTIATE_TEST_SUITE_P ( bli_dgemmtrsm_l_zen4_asm_8x24, @@ -191,7 +138,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMUkrTestPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -209,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMUkrTestPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -228,7 +175,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 10), // ldb_inc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMSmallUkrTestPrint() + (::trsmSmallUKRPrint()) ); #endif @@ -249,7 +196,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMUkrTestPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -267,7 +214,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMUkrTestPrint() + (::trsmNatUKRPrint()) ); #endif @@ -288,6 +235,6 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 10), // ldb_inc ::testing::Values(false, true) // is_memory_test ), - ::DTRSMSmallUkrTestPrint() + (::trsmSmallUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/trsm/strsm_ukr.cpp b/gtestsuite/testsuite/ukr/trsm/strsm_ukr.cpp index abbff611f..32176df2c 100644 --- a/gtestsuite/testsuite/ukr/trsm/strsm_ukr.cpp +++ b/gtestsuite/testsuite/ukr/trsm/strsm_ukr.cpp @@ -122,66 +122,6 @@ TEST_P(strsmUkrSmall, AccuracyCheck) test_trsm_small_ukr( ukr_fp, side, uploa, diaga, transa, m, n, alpha, lda, ldb, thresh, is_memory_test, BLIS_FLOAT); } - -class strsmUkrNatPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char storage = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t m = std::get<4>(str.param); - gtint_t n = std::get<5>(str.param); - gtint_t k = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - gtint_t ldc = std::get<8>(str.param); - bool is_memory_test = std::get<9>(str.param); - std::string res = - std::string("stor_") + storage - + "_diag_" + diaga - + "_uplo_" + uploa - + "_k" + std::to_string(k) - + "_alpha_" + testinghelpers::get_value_string(alpha); - ldc += (storage == 'r' || storage == 'R') ? n : m; - res += "_ldc_" + std::to_string(ldc); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - -class strsmUkrSmallPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - char transa = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - float alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(str.param); - std::string res = - std::string("side_") + side - + "_diag_" + diaga - + "_uplo_" + uploa - + "_trana_" + transa - + "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - res += "_lda_" + std::to_string( lda_inc + mn); - res += "_ldb_" + std::to_string( ldb_inc + m) - + "_m_" + std::to_string(m) - + "_n_" + std::to_string(n); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - #if defined(BLIS_KERNELS_HASWELL) && defined(GTEST_AVX2FMA3) INSTANTIATE_TEST_SUITE_P ( bli_sgemmtrsm_l_haswell_asm_6x16, @@ -198,7 +138,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::strsmUkrNatPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -216,7 +156,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::strsmUkrNatPrint() + (::trsmNatUKRPrint()) ); #endif @@ -237,6 +177,6 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 10), // ldb_inc ::testing::Values(false, true) // is_memory_test ), - ::strsmUkrSmallPrint() + (::trsmSmallUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/ukr/trsm/test_trsm_ukr.h b/gtestsuite/testsuite/ukr/trsm/test_trsm_ukr.h index 641012f85..df6152820 100644 --- a/gtestsuite/testsuite/ukr/trsm/test_trsm_ukr.h +++ b/gtestsuite/testsuite/ukr/trsm/test_trsm_ukr.h @@ -424,3 +424,66 @@ static void test_trsm_small_ukr( FT ukr_fp, char side, char uploa, char diaga, // free memory free(b_ref); } + +// Test-case logger : Used to print the test-case details based on parameters +template +class trsmSmallUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const{ + char side = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + char transa = std::get<4>(str.param); + gtint_t m = std::get<5>(str.param); + gtint_t n = std::get<6>(str.param); + T1 alpha = std::get<7>(str.param); + gtint_t lda_inc = std::get<8>(str.param); + gtint_t ldb_inc = std::get<9>(str.param); + bool is_memory_test = std::get<10>(str.param); + + std::string res = + std::string("_side_") + side + + "_diag_" + diaga + + "_uplo_" + uploa + + "_trana_" + transa + + "_alpha_" + testinghelpers::get_value_string(alpha); + gtint_t mn; + testinghelpers::set_dim_with_side( side, m, n, &mn ); + res += "_lda_" + std::to_string( lda_inc + mn); + res += "_ldb_" + std::to_string( ldb_inc + m) + + "_m_" + std::to_string(m) + + "_n_" + std::to_string(n); + res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; + return res; + } +}; + +template +class trsmNatUKRPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const{ + char storage = std::get<1>(str.param); + char uploa = std::get<2>(str.param); + char diaga = std::get<3>(str.param); + gtint_t m = std::get<4>(str.param); + gtint_t n = std::get<5>(str.param); + gtint_t k = std::get<6>(str.param); + T1 alpha = std::get<7>(str.param); + gtint_t ldc = std::get<8>(str.param); + bool is_memory_test = std::get<9>(str.param); + std::string res = + std::string("stor_") + storage + + "_diag_" + diaga + + "_uplo_" + uploa + + "_k_" + std::to_string(k) + + "_alpha_" + testinghelpers::get_value_string(alpha); + ldc += (storage == 'r' || storage == 'R') ? n : m; + res += "_ldc_" + std::to_string(ldc); + res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; + return res; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/ukr/trsm/ztrsm_ukr.cpp b/gtestsuite/testsuite/ukr/trsm/ztrsm_ukr.cpp index 0ef53c368..39f3c6303 100644 --- a/gtestsuite/testsuite/ukr/trsm/ztrsm_ukr.cpp +++ b/gtestsuite/testsuite/ukr/trsm/ztrsm_ukr.cpp @@ -124,65 +124,6 @@ TEST_P(ztrsmUkrSmall, AccuracyCheck) test_trsm_small_ukr( ukr_fp, side, uploa, diaga, transa, m, n, alpha, lda, ldb, thresh, is_memory_test, BLIS_DCOMPLEX); } -class ztrsmUkrNatPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char storage = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - gtint_t m = std::get<4>(str.param); - gtint_t n = std::get<5>(str.param); - gtint_t k = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - gtint_t ldc = std::get<8>(str.param); - bool is_memory_test = std::get<9>(str.param); - std::string res = - std::string("stor_") + storage - + "_diag_" + diaga - + "_uplo_" + uploa - + "_k_" + std::to_string(k) - + "_alpha_" + testinghelpers::get_value_string(alpha); - ldc += (storage == 'r' || storage == 'R') ? n : m; - res += "_ldc_" + std::to_string(ldc); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - -class ztrsmUkrSmallPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const{ - char side = std::get<1>(str.param); - char uploa = std::get<2>(str.param); - char diaga = std::get<3>(str.param); - char transa = std::get<4>(str.param); - gtint_t m = std::get<5>(str.param); - gtint_t n = std::get<6>(str.param); - dcomplex alpha = std::get<7>(str.param); - gtint_t lda_inc = std::get<8>(str.param); - gtint_t ldb_inc = std::get<9>(str.param); - bool is_memory_test = std::get<10>(str.param); - std::string res = - std::string("side_") + side - + "_diag_" + diaga - + "_uplo_" + uploa - + "_trana_" + transa - + "_alpha_" + testinghelpers::get_value_string(alpha); - gtint_t mn; - testinghelpers::set_dim_with_side( side, m, n, &mn ); - res += "_lda_" + std::to_string( lda_inc + mn); - res += "_ldb_" + std::to_string( ldb_inc + m) - + "_m_" + std::to_string(m) - + "_n_" + std::to_string(n); - res += is_memory_test ? "_mem_test_enabled" : "_mem_test_disabled"; - return res; - } -}; - #if defined(BLIS_KERNELS_ZEN4) && defined(GTEST_AVX512) INSTANTIATE_TEST_SUITE_P ( bli_zgemmtrsm_l_zen4_asm_4x12, @@ -202,7 +143,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::ztrsmUkrNatPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -223,7 +164,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::ztrsmUkrNatPrint() + (::trsmNatUKRPrint()) ); #endif @@ -248,7 +189,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::ztrsmUkrNatPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -269,7 +210,7 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 9, 53), // ldc ::testing::Values(false, true) // is_memory_test ), - ::ztrsmUkrNatPrint() + (::trsmNatUKRPrint()) ); INSTANTIATE_TEST_SUITE_P ( @@ -291,6 +232,6 @@ INSTANTIATE_TEST_SUITE_P ( ::testing::Values(0, 10, 194), // ldb_inc ::testing::Values(false, true) // is_memory_test ), - ::ztrsmUkrSmallPrint() + (::trsmSmallUKRPrint()) ); #endif diff --git a/gtestsuite/testsuite/util/asumv/dasumv_evt_testing.cpp b/gtestsuite/testsuite/util/asumv/dasumv_evt_testing.cpp index d6c092a1e..73a515774 100644 --- a/gtestsuite/testsuite/util/asumv/dasumv_evt_testing.cpp +++ b/gtestsuite/testsuite/util/asumv/dasumv_evt_testing.cpp @@ -79,34 +79,6 @@ TEST_P( dasumv_EVT, ExceptionData ) test_asumv( n, incx, xi, ix_exval, xj, jx_exval, thresh ); } -// Prints the test case combination -class dasumv_EVTPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 ix_exval = std::get<3>(str.param); - gtint_t xj = std::get<4>(str.param); - double jx_exval = std::get<5>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dasumv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dasumv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dasumv"; -#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); - str_name = str_name + "_" + testinghelpers::get_value_string(ix_exval); - str_name = str_name + "_X_" + std::to_string(xj); - str_name = str_name + "_" + testinghelpers::get_value_string(jx_exval); - return str_name; - } -}; - static double NaN = std::numeric_limits::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); @@ -129,7 +101,7 @@ INSTANTIATE_TEST_SUITE_P( // jx_exval = 1.0 tests for the vector with only one extreme value. ::testing::Values( 1.0, NaN, Inf, -Inf ) ), - ::dasumv_EVTPrint() + ::asumvEVTPrint() ); // EVT with non-unit stride vector containing Infs/NaNs. @@ -151,5 +123,5 @@ INSTANTIATE_TEST_SUITE_P( // jx_exval = 1.0 tests for the vector with only one extreme value. ::testing::Values( 1.0, NaN, Inf, -Inf ) ), - ::dasumv_EVTPrint() + ::asumvEVTPrint() ); diff --git a/gtestsuite/testsuite/util/asumv/dasumv_generic.cpp b/gtestsuite/testsuite/util/asumv/dasumv_generic.cpp index 34a77dfb5..81d7b7958 100644 --- a/gtestsuite/testsuite/util/asumv/dasumv_generic.cpp +++ b/gtestsuite/testsuite/util/asumv/dasumv_generic.cpp @@ -66,26 +66,6 @@ TEST_P( dasumvGenericTest, RandomData ) test_asumv( n, incx, thresh ); } -// Prints the test case combination -class dasumvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "dasumv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dasumv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dasumv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, dasumvGenericTest, @@ -109,7 +89,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::dasumvGenericTestPrint() + ::asumvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -136,7 +116,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(3) ) ), - ::dasumvGenericTestPrint() + ::asumvGenericPrint() ); // @note: ASUMV is supposed to set sum as 0 and return early in case incx <= 0, @@ -167,6 +147,6 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(-3) ) ), - ::dasumvGenericTestPrint() + ::asumvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/util/asumv/dzasumv_generic.cpp b/gtestsuite/testsuite/util/asumv/dzasumv_generic.cpp index 29240b409..15ef2255f 100644 --- a/gtestsuite/testsuite/util/asumv/dzasumv_generic.cpp +++ b/gtestsuite/testsuite/util/asumv/dzasumv_generic.cpp @@ -67,26 +67,6 @@ TEST_P( dzasumvGenericTest, RandomData ) test_asumv( n, incx, thresh ); } -// Prints the test case combination -class dzasumvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "dzasumv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dzasumv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dzasumv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, dzasumvGenericTest, @@ -110,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::dzasumvGenericTestPrint() + ::asumvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -137,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(3) ) ), - ::dzasumvGenericTestPrint() + ::asumvGenericPrint() ); // @note: ASUMV is supposed to set sum as 0 and return early in case incx <= 0, @@ -168,6 +148,6 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(-3) ) ), - ::dzasumvGenericTestPrint() + ::asumvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/util/asumv/sasumv_generic.cpp b/gtestsuite/testsuite/util/asumv/sasumv_generic.cpp index d3a7fc252..be3bfb1d5 100644 --- a/gtestsuite/testsuite/util/asumv/sasumv_generic.cpp +++ b/gtestsuite/testsuite/util/asumv/sasumv_generic.cpp @@ -66,26 +66,6 @@ TEST_P( sasumvGenericTest, RandomData ) test_asumv( n, incx, thresh ); } -// Prints the test case combination -class sasumvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "sasumv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_sasumv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_sasumv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, sasumvGenericTest, @@ -109,7 +89,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::sasumvGenericTestPrint() + ::asumvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -136,7 +116,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(3) ) ), - ::sasumvGenericTestPrint() + ::asumvGenericPrint() ); // @note: ASUMV is supposed to set sum as 0 and return early in case incx <= 0, @@ -167,6 +147,6 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(-3) ) ), - ::sasumvGenericTestPrint() + ::asumvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/util/asumv/scasumv_generic.cpp b/gtestsuite/testsuite/util/asumv/scasumv_generic.cpp index 31f929bdb..6c970e244 100644 --- a/gtestsuite/testsuite/util/asumv/scasumv_generic.cpp +++ b/gtestsuite/testsuite/util/asumv/scasumv_generic.cpp @@ -67,26 +67,6 @@ TEST_P( scasumvGenericTest, RandomData ) test_asumv( n, incx, thresh ); } -// Prints the test case combination -class scasumvGenericTestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "scasumv_"; -#elif TEST_CBLAS - std::string str_name = "cblas_scasumv"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_scasumv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - INSTANTIATE_TEST_SUITE_P( unitPositiveIncrement, scasumvGenericTest, @@ -110,7 +90,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(1) ) ), - ::scasumvGenericTestPrint() + ::asumvGenericPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -137,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(3) ) ), - ::scasumvGenericTestPrint() + ::asumvGenericPrint() ); // @note: ASUMV is supposed to set sum as 0 and return early in case incx <= 0, @@ -168,6 +148,6 @@ INSTANTIATE_TEST_SUITE_P( gtint_t(-3) ) ), - ::scasumvGenericTestPrint() + ::asumvGenericPrint() ); #endif diff --git a/gtestsuite/testsuite/util/asumv/test_asumv.h b/gtestsuite/testsuite/util/asumv/test_asumv.h index 89ef6ebfb..b5e93c91f 100644 --- a/gtestsuite/testsuite/util/asumv/test_asumv.h +++ b/gtestsuite/testsuite/util/asumv/test_asumv.h @@ -72,7 +72,7 @@ void test_asumv( gtint_t n, gtint_t incx, double thresh ) * @brief Used to insert Exception Values in x vector. */ template -void test_asumv( gtint_t n, gtint_t incx, gtint_t xi, double ix_exval, +void test_asumv( gtint_t n, gtint_t incx, gtint_t xi, T ix_exval, gtint_t xj, T jx_exval, double thresh ) { // Get real type from T. @@ -105,3 +105,42 @@ void test_asumv( gtint_t n, gtint_t incx, gtint_t xi, double ix_exval, //---------------------------------------------------------- computediff( "asum", asum, asum_ref, thresh, true ); } + + +// Test-case logger : Used to print the test-case details based on parameters +class asumvGenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 +class asumvEVTPrint { +public: + std::string operator()( + testing::TestParamInfo> 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 ix_exval = std::get<3>(str.param); + gtint_t xj = std::get<4>(str.param); + T jx_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); + str_name = str_name + "_" + testinghelpers::get_value_string(ix_exval); + str_name = str_name + "_X_" + std::to_string(xj); + str_name = str_name + "_" + testinghelpers::get_value_string(jx_exval); + return str_name; + } +}; \ No newline at end of file diff --git a/gtestsuite/testsuite/util/nrm2/dnrm2_extreme_values.cpp b/gtestsuite/testsuite/util/nrm2/dnrm2_extreme_values.cpp index 4ba5be2ed..b25e9da38 100644 --- a/gtestsuite/testsuite/util/nrm2/dnrm2_extreme_values.cpp +++ b/gtestsuite/testsuite/util/nrm2/dnrm2_extreme_values.cpp @@ -62,40 +62,6 @@ TEST_P( dnrm2_EVT, EVT ) test_nrm2(n, incx, i, iexval, j, jexval); } -// Prints the test case combination -class dnrm2_TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - // vector length: - gtint_t n = std::get<0>(str.param); - // stride size for x: - gtint_t incx = std::get<1>(str.param); - // index with extreme value iexval. - gtint_t i = std::get<2>(str.param); - double iexval = std::get<3>(str.param); - // index with extreme value jexval. - gtint_t j = std::get<4>(str.param); - double jexval = std::get<5>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dnrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dnrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dnormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_i" + std::to_string(i); - std::string iexval_str = testinghelpers::get_value_string(iexval); - str_name = str_name + "_" + iexval_str; - str_name = str_name + "_j" + std::to_string(j); - std::string jexval_str = testinghelpers::get_value_string(jexval); - str_name = str_name + "_" + jexval_str; - return str_name; - } -}; - static double NaN = std::numeric_limits::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); @@ -126,7 +92,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(2), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -144,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(6), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F4), we use n = 12 @@ -164,7 +130,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(11), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); // Now let's check the combination of a vectorized path and @@ -185,7 +151,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(8), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); // Multithreading unit tester @@ -233,7 +199,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(4, 17, 125, 201), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); // Instantiator if AOCL_DYNAMIC is enabled @@ -261,5 +227,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(1500000, 2500000), ::testing::Values(-Inf, NaN) ), - ::dnrm2_TestPrint() + ::nrm2EVTPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/dnrm2_generic.cpp b/gtestsuite/testsuite/util/nrm2/dnrm2_generic.cpp index 7cd559ad5..34087bc24 100644 --- a/gtestsuite/testsuite/util/nrm2/dnrm2_generic.cpp +++ b/gtestsuite/testsuite/util/nrm2/dnrm2_generic.cpp @@ -66,26 +66,6 @@ TEST_P( dnrm2Test, RandomData ) test_nrm2( n, incx, thresh ); } -// Prints the test case combination -class dnrm2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "dnrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dnrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_dnormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - /** * dnrm2 implementation is composed by two parts: * - vectorized path for n>4 @@ -118,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dnrm2TestPrint() + ::nrm2GenericPrint() ); // Multithreading unit tester @@ -168,7 +148,7 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dnrm2TestPrint() + ::nrm2GenericPrint() ); // Instantiator if AOCL_DYNAMIC is enabled @@ -194,5 +174,5 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dnrm2TestPrint() + ::nrm2GenericPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/dznrm2_extreme_values.cpp b/gtestsuite/testsuite/util/nrm2/dznrm2_extreme_values.cpp index be70bb578..3be6c2f44 100644 --- a/gtestsuite/testsuite/util/nrm2/dznrm2_extreme_values.cpp +++ b/gtestsuite/testsuite/util/nrm2/dznrm2_extreme_values.cpp @@ -62,40 +62,6 @@ TEST_P( dznrm2_EVT, EVT ) test_nrm2(n, incx, i, iexval, j, jexval); } -// Prints the test case combination -class dznrm2_TestPrint{ -public: - std::string operator()( - testing::TestParamInfo> str) const { - // vector length: - gtint_t n = std::get<0>(str.param); - // stride size for x: - gtint_t incx = std::get<1>(str.param); - // index with extreme value iexval. - gtint_t i = std::get<2>(str.param); - dcomplex iexval = std::get<3>(str.param); - // index with extreme value jexval. - gtint_t j = std::get<4>(str.param); - dcomplex jexval = std::get<5>(str.param); -#ifdef TEST_BLAS - std::string str_name = "dznrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dznrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_znormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_i" + std::to_string(i); - std::string iexval_str = "_Re_" + testinghelpers::get_value_string(iexval.real) + "_Im_" + testinghelpers::get_value_string(iexval.imag); - str_name = str_name + iexval_str; - str_name = str_name + "_j" + std::to_string(j); - std::string jexval_str = "_Re_" + testinghelpers::get_value_string(jexval.real) + "_Im_" + testinghelpers::get_value_string(jexval.imag); - str_name = str_name + jexval_str; - return str_name; - } -}; - static double NaN = std::numeric_limits::quiet_NaN(); static double Inf = std::numeric_limits::infinity(); /** @@ -125,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(1), ::testing::Values(dcomplex{1.0, 2.0}, dcomplex{NaN, 1.0}, dcomplex{Inf, 9.0}, dcomplex{-1.0, -Inf}, dcomplex{2.0, NaN}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -143,7 +109,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(3), ::testing::Values(dcomplex{1.0, 2.0}, dcomplex{NaN, 1.0}, dcomplex{Inf, 9.0}, dcomplex{-1.0, -Inf}, dcomplex{2.0, NaN}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F2), we use n = 6 @@ -163,7 +129,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(5), ::testing::Values(dcomplex{1.0, 2.0}, dcomplex{NaN, 1.0}, dcomplex{Inf, 9.0}, dcomplex{-1.0, -Inf}, dcomplex{2.0, NaN}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); // Now let's check the combination of a vectorized path and @@ -184,7 +150,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(6), ::testing::Values(dcomplex{NaN, 1.0}, dcomplex{Inf, 9.0}, dcomplex{-1.0, -Inf}, dcomplex{2.0, NaN}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); // Mutlthreading Unit Tester @@ -233,7 +199,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(6, 25, 64, 127), ::testing::Values(dcomplex{NaN, 1.0}, dcomplex{Inf, 9.0}, dcomplex{-1.0, -Inf}, dcomplex{2.0, NaN}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); // Instantiator if AOCL_DYNAMIC is enabled @@ -259,5 +225,5 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(1100000, 1500000), ::testing::Values(dcomplex{NaN, Inf}, dcomplex{-Inf, NaN}, dcomplex{Inf, 0.0}) ), - ::dznrm2_TestPrint() + ::nrm2EVTPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/dznrm2_generic.cpp b/gtestsuite/testsuite/util/nrm2/dznrm2_generic.cpp index ebfe1f284..f7e32c3d9 100644 --- a/gtestsuite/testsuite/util/nrm2/dznrm2_generic.cpp +++ b/gtestsuite/testsuite/util/nrm2/dznrm2_generic.cpp @@ -67,26 +67,6 @@ TEST_P( dznrm2Test, RandomData ) test_nrm2(n, incx, thresh); } -// Prints the test case combination -class dznrm2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "dznrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_dznrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_znormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - /** * dznrm2 implementation is composed by two parts: * - vectorized path for n>2 @@ -118,7 +98,7 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dznrm2TestPrint() + ::nrm2GenericPrint() ); // Multithreading unit tester @@ -162,7 +142,7 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dznrm2TestPrint() + ::nrm2GenericPrint() ); // Instantiator if AOCL_DYNAMIC is enabled @@ -186,5 +166,5 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::dznrm2TestPrint() + ::nrm2GenericPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/scnrm2_extreme_values.cpp b/gtestsuite/testsuite/util/nrm2/scnrm2_extreme_values.cpp index 68ca5ed83..2736f0a10 100644 --- a/gtestsuite/testsuite/util/nrm2/scnrm2_extreme_values.cpp +++ b/gtestsuite/testsuite/util/nrm2/scnrm2_extreme_values.cpp @@ -62,40 +62,6 @@ TEST_P( scnrm2_EVT, EVT ) test_nrm2(n, incx, i, iexval, j, jexval); } -// Prints the test case combination -class scnrm2_TestPrint{ -public: - std::string operator()( - testing::TestParamInfo> str) const { - // vector length: - gtint_t n = std::get<0>(str.param); - // stride size for x: - gtint_t incx = std::get<1>(str.param); - // index with extreme value iexval. - gtint_t i = std::get<2>(str.param); - scomplex iexval = std::get<3>(str.param); - // index with extreme value jexval. - gtint_t j = std::get<4>(str.param); - scomplex jexval = std::get<5>(str.param); -#ifdef TEST_BLAS - std::string str_name = "scnrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_scnrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cnormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_i" + std::to_string(i); - std::string iexval_str = "_Re_" + testinghelpers::get_value_string(iexval.real) + "_Im_" + testinghelpers::get_value_string(iexval.imag); - str_name = str_name + iexval_str; - str_name = str_name + "_j" + std::to_string(j); - std::string jexval_str = "_Re_" + testinghelpers::get_value_string(jexval.real) + "_Im_" + testinghelpers::get_value_string(jexval.imag); - str_name = str_name + jexval_str; - return str_name; - } -}; - static float NaN = std::numeric_limits::quiet_NaN(); static float Inf = std::numeric_limits::infinity(); /** @@ -126,7 +92,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(1), ::testing::Values(scomplex{1.0, 2.0}, scomplex{NaN, 1.0}, scomplex{Inf, 9.0}, scomplex{-1.0, -Inf}, scomplex{2.0, NaN}) ), - ::scnrm2_TestPrint() + ::nrm2EVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -144,7 +110,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(30), ::testing::Values(scomplex{1.0, 2.0}, scomplex{NaN, 1.0}, scomplex{Inf, 9.0}, scomplex{-1.0, -Inf}, scomplex{2.0, NaN}) ), - ::scnrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F12), we use n = 76 = 4*16+12 @@ -164,7 +130,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(70), ::testing::Values(scomplex{1.0, 2.0}, scomplex{NaN, 1.0}, scomplex{Inf, 9.0}, scomplex{-1.0, -Inf}, scomplex{2.0, NaN}) ), - ::scnrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F8), we use n = 72 = 4*16+8 @@ -184,7 +150,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(70), ::testing::Values(scomplex{1.0, 2.0}, scomplex{NaN, 1.0}, scomplex{Inf, 9.0}, scomplex{-1.0, -Inf}, scomplex{2.0, NaN}) ), - ::scnrm2_TestPrint() + ::nrm2EVTPrint() ); // Now let's check the combination of a vectorized path and @@ -205,6 +171,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(68), ::testing::Values(scomplex{NaN, 1.0}, scomplex{Inf, 9.0}, scomplex{-1.0, -Inf}, scomplex{2.0, NaN}) ), - ::scnrm2_TestPrint() + ::nrm2EVTPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/scnrm2_generic.cpp b/gtestsuite/testsuite/util/nrm2/scnrm2_generic.cpp index 022f6c799..a5441eb80 100644 --- a/gtestsuite/testsuite/util/nrm2/scnrm2_generic.cpp +++ b/gtestsuite/testsuite/util/nrm2/scnrm2_generic.cpp @@ -67,26 +67,6 @@ TEST_P( scnrm2Test, RandomData ) test_nrm2(n, incx, thresh); } -// Prints the test case combination -class scnrm2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "scnrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_scnrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_cnormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - /** * scnrm2 implementation is composed by two parts: * - vectorized path for n>=64 @@ -119,5 +99,5 @@ INSTANTIATE_TEST_SUITE_P( #endif ) ), - ::scnrm2TestPrint() + ::nrm2GenericPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/snrm2_extreme_values.cpp b/gtestsuite/testsuite/util/nrm2/snrm2_extreme_values.cpp index 19206c3af..eb4aeda16 100644 --- a/gtestsuite/testsuite/util/nrm2/snrm2_extreme_values.cpp +++ b/gtestsuite/testsuite/util/nrm2/snrm2_extreme_values.cpp @@ -62,40 +62,6 @@ TEST_P( snrm2_EVT, EVT ) test_nrm2(n, incx, i, iexval, j, jexval); } -// Prints the test case combination -class snrm2_TestPrint { -public: - std::string operator()( - testing::TestParamInfo> str) const { - // vector length: - gtint_t n = std::get<0>(str.param); - // stride size for x: - gtint_t incx = std::get<1>(str.param); - // index with extreme value iexval. - gtint_t i = std::get<2>(str.param); - float iexval = std::get<3>(str.param); - // index with extreme value jexval. - gtint_t j = std::get<4>(str.param); - float jexval = std::get<5>(str.param); -#ifdef TEST_BLAS - std::string str_name = "snrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_snrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_snormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - str_name = str_name + "_i" + std::to_string(i); - std::string iexval_str = testinghelpers::get_value_string(iexval); - str_name = str_name + "_" + iexval_str; - str_name = str_name + "_j" + std::to_string(j); - std::string jexval_str = testinghelpers::get_value_string(jexval); - str_name = str_name + "_" + jexval_str; - return str_name; - } -}; - static float NaN = std::numeric_limits::quiet_NaN(); static float Inf = std::numeric_limits::infinity(); @@ -130,7 +96,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(2), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::snrm2_TestPrint() + ::nrm2EVTPrint() ); INSTANTIATE_TEST_SUITE_P( @@ -148,7 +114,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(26), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::snrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F24), we use n = 88 = 2*32+24 @@ -168,7 +134,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(80), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::snrm2_TestPrint() + ::nrm2EVTPrint() ); // To test the second for-loop (F16), we use n = 80 = 2*32+16 @@ -188,7 +154,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(75), ::testing::Values(1.0, NaN, Inf, -Inf) ), - ::snrm2_TestPrint() + ::nrm2EVTPrint() ); // Now let's check the combination of a vectorized path and @@ -209,6 +175,6 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(65), ::testing::Values(NaN, Inf, -Inf) ), - ::snrm2_TestPrint() + ::nrm2EVTPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/snrm2_generic.cpp b/gtestsuite/testsuite/util/nrm2/snrm2_generic.cpp index 6f38976b2..9eccf2c65 100644 --- a/gtestsuite/testsuite/util/nrm2/snrm2_generic.cpp +++ b/gtestsuite/testsuite/util/nrm2/snrm2_generic.cpp @@ -66,26 +66,6 @@ TEST_P( snrm2Test, RandomData ) test_nrm2( n, incx, thresh ); } -// Prints the test case combination -class snrm2TestPrint { -public: - std::string operator()( - testing::TestParamInfo> 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 = "snrm2_"; -#elif TEST_CBLAS - std::string str_name = "cblas_snrm2"; -#else //#elif TEST_BLIS_TYPED - std::string str_name = "bli_snormfv"; -#endif - str_name += "_n_" + std::to_string(n); - str_name += "_incx_" + testinghelpers::get_value_string(incx); - return str_name; - } -}; - /** * Note: snrm2 scalar ONLY implementation is used, but we write the test * using values that worked for the vectorized path for the future. @@ -121,5 +101,5 @@ INSTANTIATE_TEST_SUITE_P( #endif ) // stride size for x ), - ::snrm2TestPrint() + ::nrm2GenericPrint() ); diff --git a/gtestsuite/testsuite/util/nrm2/test_nrm2.h b/gtestsuite/testsuite/util/nrm2/test_nrm2.h index f32735e16..3927f9885 100644 --- a/gtestsuite/testsuite/util/nrm2/test_nrm2.h +++ b/gtestsuite/testsuite/util/nrm2/test_nrm2.h @@ -99,3 +99,49 @@ void test_nrm2( gtint_t n, gtint_t incx, gtint_t i, T iexval, gtint_t j = 0, T j // Compare using NaN/Inf checks. computediff( "norm", norm, norm_ref, true ); } + +// Test-case logger : Used to print the test-case details based on parameters +class nrm2GenericPrint { +public: + std::string operator()( + testing::TestParamInfo> 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; + } +}; + + +// Test-case logger : Used to print the test-case details based on parameters +template +class nrm2EVTPrint { +public: + std::string operator()( + testing::TestParamInfo> str) const { + // vector length: + gtint_t n = std::get<0>(str.param); + // stride size for x: + gtint_t incx = std::get<1>(str.param); + // index with extreme value iexval. + gtint_t i = std::get<2>(str.param); + T iexval = std::get<3>(str.param); + // index with extreme value jexval. + gtint_t j = std::get<4>(str.param); + T jexval = 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 + "_i" + std::to_string(i); + std::string iexval_str = testinghelpers::get_value_string(iexval); + str_name = str_name + "_" + iexval_str; + str_name = str_name + "_j" + std::to_string(j); + std::string jexval_str = testinghelpers::get_value_string(jexval); + str_name = str_name + "_" + jexval_str; + return str_name; + } +}; \ No newline at end of file