From ef5cbf7c9a7cdc641f79563e28d356ba45b5e674 Mon Sep 17 00:00:00 2001 From: Edward Smyth Date: Fri, 20 Sep 2024 16:04:18 -0400 Subject: [PATCH] GTestSuite: More threshold changes Various changes from testing code paths with both gcc and aocc. AMD-Internal: [CPUPL-4378] Change-Id: I8964d8ab4e1f5669026af606598c2eb3dfddde16 --- .../level1/axpbyv/caxpbyv/caxpbyv_generic.cpp | 1 - .../level1/axpbyv/caxpbyv/evt/caxpbyv_evt.cpp | 1 - .../level1/axpbyv/zaxpbyv/evt/zaxpbyv_evt.cpp | 1 - .../level1/axpbyv/zaxpbyv/zaxpbyv_generic.cpp | 1 - .../testsuite/level1/axpyf/daxpyf_generic.cpp | 21 ++- .../level1/axpyv/zaxpyv/zaxpyv_evt.cpp | 11 +- .../level1/axpyv/zaxpyv/zaxpyv_generic.cpp | 16 +-- .../testsuite/level1/dotxf/ddotxf_generic.cpp | 6 +- .../level1/scalv/cscalv/cscalv_generic.cpp | 13 +- .../level2/gemv/cgemv/cgemv_generic.cpp | 14 +- .../level2/gemv/zgemv/zgemv_generic.cpp | 14 +- .../level2/ger/cger/cger_generic.cpp | 13 +- .../level2/ger/zger/zger_generic.cpp | 13 +- .../testsuite/level2/hemv/chemv_generic.cpp | 8 +- .../testsuite/level2/hemv/zhemv_generic.cpp | 14 +- .../testsuite/level2/her/cher_generic.cpp | 15 ++- .../testsuite/level2/her/zher_generic.cpp | 15 ++- .../testsuite/level2/her2/cher2_generic.cpp | 18 ++- .../testsuite/level2/her2/zher2_generic.cpp | 15 ++- .../testsuite/level2/symv/dsymv_generic.cpp | 17 ++- .../testsuite/level2/symv/ssymv_generic.cpp | 17 ++- .../testsuite/level2/syr2/dsyr2_generic.cpp | 14 +- .../testsuite/level2/syr2/ssyr2_generic.cpp | 14 +- .../level2/trmv/ctrmv/ctrmv_generic.cpp | 10 +- .../level2/trmv/dtrmv/dtrmv_generic.cpp | 10 +- .../level2/trmv/strmv/strmv_generic.cpp | 10 +- .../level2/trmv/ztrmv/ztrmv_generic.cpp | 10 +- .../level2/trsv/ctrsv/ctrsv_generic.cpp | 15 ++- .../level2/trsv/dtrsv/dtrsv_generic.cpp | 18 ++- .../level2/trsv/strsv/strsv_generic.cpp | 21 ++- .../level2/trsv/ztrsv/ztrsv_generic.cpp | 15 ++- .../level3/gemm/cgemm/cgemm_generic.cpp | 11 +- .../level3/gemm/dgemm/dgemm_generic.cpp | 12 +- .../level3/gemm/sgemm/sgemm_generic.cpp | 14 +- .../level3/gemm/zgemm/zgemm_generic.cpp | 12 +- .../IIT_ERS/gemm_compute_IIT_ERS.cpp | 126 +++++++++++++++++- .../dgemm_compute/dgemm_compute_generic.cpp | 30 ++++- .../sgemm_compute/sgemm_compute_generic.cpp | 30 ++++- .../level3/gemmt/cgemmt/cgemmt_generic.cpp | 12 +- .../level3/gemmt/dgemmt/dgemmt_generic.cpp | 11 +- .../level3/gemmt/sgemmt/sgemmt_generic.cpp | 11 +- .../testsuite/level3/gemmt/test_gemmt.h | 3 +- .../testsuite/level3/hemm/chemm_generic.cpp | 11 +- .../testsuite/level3/her2k/cher2k_generic.cpp | 11 +- .../testsuite/level3/her2k/zher2k_generic.cpp | 11 +- .../testsuite/level3/herk/cherk_generic.cpp | 12 +- .../testsuite/level3/herk/zherk_generic.cpp | 12 +- .../testsuite/level3/symm/csymm_generic.cpp | 11 +- .../testsuite/level3/symm/zsymm_generic.cpp | 14 +- .../testsuite/level3/syrk/dsyrk_generic.cpp | 11 +- .../testsuite/level3/trmm/dtrmm_generic.cpp | 13 +- .../testsuite/level3/trmm/strmm_generic.cpp | 13 +- .../level3/trsm/dtrsm/dtrsm_generic.cpp | 2 +- .../level3/trsm/dtrsm/evt/dtrsm_evt.cpp | 26 +++- .../ukr/gemm/cgemm/cgemm_ukernel.cpp | 22 ++- .../ukr/gemm/dgemm/dgemm_ukernel.cpp | 42 ++++-- .../ukr/gemm/sgemm/sgemm_ukernel.cpp | 20 ++- .../ukr/gemm/zgemm/zgemm_ukernel.cpp | 21 ++- .../testsuite/ukr/scal2v/zscal2v_ukr.cpp | 7 +- gtestsuite/testsuite/ukr/scalv/cscalv_ukr.cpp | 8 +- .../testsuite/ukr/trsm/ztrsm/ztrsm_ukr.cpp | 3 +- 61 files changed, 655 insertions(+), 268 deletions(-) diff --git a/gtestsuite/testsuite/level1/axpbyv/caxpbyv/caxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/caxpbyv/caxpbyv_generic.cpp index 829ff5237..75bed402b 100644 --- a/gtestsuite/testsuite/level1/axpbyv/caxpbyv/caxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/caxpbyv/caxpbyv_generic.cpp @@ -67,7 +67,6 @@ TEST_P( caxpbyvGeneric, API ) // Check gtestsuite axpbyv.h (no netlib version) for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. // NOTE : Every mul for complex types involves 3 ops(2 muls + 1 add) double thresh; double adj = 3; diff --git a/gtestsuite/testsuite/level1/axpbyv/caxpbyv/evt/caxpbyv_evt.cpp b/gtestsuite/testsuite/level1/axpbyv/caxpbyv/evt/caxpbyv_evt.cpp index 5b219d7ad..c12765c5c 100644 --- a/gtestsuite/testsuite/level1/axpbyv/caxpbyv/evt/caxpbyv_evt.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/caxpbyv/evt/caxpbyv_evt.cpp @@ -82,7 +82,6 @@ TEST_P( caxpbyvEVT, API ) // Check gtestsuite axpbyv.h (no netlib version) for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. // NOTE : Every mul for complex types involves 3 ops(2 muls + 1 add) double thresh; double adj = 3; diff --git a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/evt/zaxpbyv_evt.cpp b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/evt/zaxpbyv_evt.cpp index 6d72297ba..73ece6fef 100644 --- a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/evt/zaxpbyv_evt.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/evt/zaxpbyv_evt.cpp @@ -82,7 +82,6 @@ TEST_P( zaxpbyvEVT, API ) // Check gtestsuite axpbyv.h (no netlib version) for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. // NOTE : Every mul for complex types involves 3 ops(2 muls + 1 add) double thresh; double adj = 3; diff --git a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/zaxpbyv_generic.cpp b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/zaxpbyv_generic.cpp index a5a8d3135..716a7d0bb 100644 --- a/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/zaxpbyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpbyv/zaxpbyv/zaxpbyv_generic.cpp @@ -67,7 +67,6 @@ TEST_P( zaxpbyvGeneric, API ) // Check gtestsuite axpbyv.h (no netlib version) for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. // NOTE : Every mul for complex types involves 3 ops(2 muls + 1 add) double thresh; double adj = 3; diff --git a/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp b/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp index 37cd73eae..6fddf6c51 100644 --- a/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyf/daxpyf_generic.cpp @@ -78,10 +78,25 @@ TEST_P( daxpyfGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = 0.0; else if (alpha == testinghelpers::ONE()) - thresh = (b+1)*testinghelpers::getEpsilon(); + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 6.6; +#endif + thresh = adj*(b+1)*testinghelpers::getEpsilon(); + } else - thresh = (2*b+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 6.9; +#endif + thresh = adj*(2*b+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call generic test body using those parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_evt.cpp b/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_evt.cpp index 3b5f07273..9d584f1fb 100644 --- a/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_evt.cpp +++ b/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_evt.cpp @@ -79,8 +79,6 @@ TEST_P( zaxpyvEVT, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Small adjustment has been applied for complex data. - double adj = 1.5; if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO()) @@ -88,8 +86,15 @@ TEST_P( zaxpyvEVT, API ) else if (alpha == testinghelpers::ONE()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.5; +#endif thresh = adj*2*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call generic test body using those parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_generic.cpp b/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_generic.cpp index 7ac3a10be..ea39f15b8 100644 --- a/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_generic.cpp +++ b/gtestsuite/testsuite/level1/axpyv/zaxpyv/zaxpyv_generic.cpp @@ -64,14 +64,7 @@ TEST_P( zaxpyvGeneric, API ) // Check gtestsuite axpyv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With small adjustment applied for complex data. double thresh; - // Threshold adjustment -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.02; -#else - double adj = 1.0; -#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO()) @@ -79,8 +72,15 @@ TEST_P( zaxpyvGeneric, API ) else if (alpha == testinghelpers::ONE()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.02; +#else + double adj = 1.0; +#endif thresh = adj*2*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call generic test body using those parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp b/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp index 71589d317..06aa4345e 100644 --- a/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp +++ b/gtestsuite/testsuite/level1/dotxf/ddotxf_generic.cpp @@ -81,7 +81,7 @@ TEST_P( ddotxfGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Threshold adjustment + // Threshold adjustment if (m == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO()) @@ -97,7 +97,7 @@ TEST_P( ddotxfGeneric, API ) #ifdef BLIS_INT_ELEMENT_TYPE double adj = 1.0; #else - double adj = 3.9; + double adj = 4.4; #endif thresh = adj*(m+1)*testinghelpers::getEpsilon(); } @@ -111,7 +111,7 @@ TEST_P( ddotxfGeneric, API ) #ifdef BLIS_INT_ELEMENT_TYPE double adj = 1.0; #else - double adj = 5.2; + double adj = 5.3; #endif thresh = adj*(2*m+1)*testinghelpers::getEpsilon(); } diff --git a/gtestsuite/testsuite/level1/scalv/cscalv/cscalv_generic.cpp b/gtestsuite/testsuite/level1/scalv/cscalv/cscalv_generic.cpp index 9c5d46bdb..fd7b87aa8 100644 --- a/gtestsuite/testsuite/level1/scalv/cscalv/cscalv_generic.cpp +++ b/gtestsuite/testsuite/level1/scalv/cscalv/cscalv_generic.cpp @@ -63,15 +63,22 @@ TEST_P( cscalvGeneric, API ) // Check gtestsuite scalv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. + // With adjustment applied for complex data. double thresh; if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() || alpha == testinghelpers::ONE()) thresh = 0.0; else - thresh = testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.01; +#else + double adj = 1.01; +#endif + thresh = adj*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call generic test body using those parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/gemv/cgemv/cgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/cgemv/cgemv_generic.cpp index 236b728b2..a0f1c459c 100644 --- a/gtestsuite/testsuite/level2/gemv/cgemv/cgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/cgemv/cgemv_generic.cpp @@ -85,7 +85,6 @@ TEST_P( cgemvGeneric, API ) // Check gtestsuite gemv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -94,11 +93,18 @@ TEST_P( cgemvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.1; +#endif if(( transa == 'n' ) || ( transa == 'N' )) - thresh = (3*n+1)*testinghelpers::getEpsilon(); + thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); else - thresh = (3*m+1)*testinghelpers::getEpsilon(); - + thresh = adj*(3*m+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/gemv/zgemv/zgemv_generic.cpp b/gtestsuite/testsuite/level2/gemv/zgemv/zgemv_generic.cpp index 145bf0165..b960f8597 100644 --- a/gtestsuite/testsuite/level2/gemv/zgemv/zgemv_generic.cpp +++ b/gtestsuite/testsuite/level2/gemv/zgemv/zgemv_generic.cpp @@ -85,7 +85,6 @@ TEST_P( zgemvGeneric, API ) // Check gtestsuite gemv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -94,11 +93,18 @@ TEST_P( zgemvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.1; +#endif if(( transa == 'n' ) || ( transa == 'N' )) - thresh = (3*n+1)*testinghelpers::getEpsilon(); + thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); else - thresh = (3*m+1)*testinghelpers::getEpsilon(); - + thresh = adj*(3*m+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/ger/cger/cger_generic.cpp b/gtestsuite/testsuite/level2/ger/cger/cger_generic.cpp index 7a1f45023..d08211b24 100644 --- a/gtestsuite/testsuite/level2/ger/cger/cger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/cger/cger_generic.cpp @@ -78,14 +78,19 @@ TEST_P( cgerGeneric, API ) // Check gtestsuite ger.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; - double adj = 3.0; if (m == 0 || n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.8; +#endif thresh = adj*3*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- @@ -231,4 +236,4 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( gtint_t(0), gtint_t(3) ) ), ::gerGenericPrint() - ); \ No newline at end of file + ); diff --git a/gtestsuite/testsuite/level2/ger/zger/zger_generic.cpp b/gtestsuite/testsuite/level2/ger/zger/zger_generic.cpp index c9474dbd4..8bc491361 100644 --- a/gtestsuite/testsuite/level2/ger/zger/zger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/zger/zger_generic.cpp @@ -82,8 +82,15 @@ TEST_P( zgerGeneric, API ) if (m == 0 || n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else - thresh = 7*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.9; +#endif + thresh = adj*3*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- @@ -189,4 +196,4 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values( gtint_t(0), gtint_t(3) ) ), ::gerGenericPrint() - ); \ No newline at end of file + ); diff --git a/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp b/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp index 01c876c88..94b6f1562 100644 --- a/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp +++ b/gtestsuite/testsuite/level2/hemv/chemv_generic.cpp @@ -83,6 +83,12 @@ TEST_P( chemvGeneric, API ) // of output, and hence the multipler for epsilon. // No adjustment applied yet for complex data. double thresh; + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.2; +#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) @@ -90,7 +96,7 @@ TEST_P( chemvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else - thresh = (3*n+1)*testinghelpers::getEpsilon(); + thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call test body using these parameters diff --git a/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp b/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp index 0fbba2255..9fc2de9de 100644 --- a/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp +++ b/gtestsuite/testsuite/level2/hemv/zhemv_generic.cpp @@ -83,11 +83,6 @@ TEST_P( zhemvGeneric, API ) // of output, and hence the multipler for epsilon. // With adjustment applied for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 2.4; -#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) @@ -95,8 +90,15 @@ TEST_P( zhemvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.4; +#endif thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/her/cher_generic.cpp b/gtestsuite/testsuite/level2/her/cher_generic.cpp index b309baa05..a8d27ad82 100644 --- a/gtestsuite/testsuite/level2/her/cher_generic.cpp +++ b/gtestsuite/testsuite/level2/her/cher_generic.cpp @@ -72,18 +72,19 @@ TEST_P( cherGeneric, API ) // Check gtestsuite her.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 2.0; -#endif if (n == 0 || alpha == 0.0f) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.0; +#endif thresh = adj*3*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/her/zher_generic.cpp b/gtestsuite/testsuite/level2/her/zher_generic.cpp index 9a9eb90d9..6dce885b3 100644 --- a/gtestsuite/testsuite/level2/her/zher_generic.cpp +++ b/gtestsuite/testsuite/level2/her/zher_generic.cpp @@ -72,18 +72,19 @@ TEST_P( zherGeneric, API ) // Check gtestsuite her.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 2.0; -#endif if (n == 0 || alpha == 0.0) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.0; +#endif thresh = adj*3*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/her2/cher2_generic.cpp b/gtestsuite/testsuite/level2/her2/cher2_generic.cpp index 4ffbaa1a9..93a3e98e6 100644 --- a/gtestsuite/testsuite/level2/her2/cher2_generic.cpp +++ b/gtestsuite/testsuite/level2/her2/cher2_generic.cpp @@ -78,21 +78,19 @@ TEST_P( cher2Generic, API ) // Check gtestsuite her2.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 4.0; - #ifdef REF_IS_MKL - adj = 6.0; - #endif -#endif if (n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 6.1; +#endif thresh = adj*6*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/her2/zher2_generic.cpp b/gtestsuite/testsuite/level2/her2/zher2_generic.cpp index c8cdcc726..be650917a 100644 --- a/gtestsuite/testsuite/level2/her2/zher2_generic.cpp +++ b/gtestsuite/testsuite/level2/her2/zher2_generic.cpp @@ -78,18 +78,19 @@ TEST_P( zher2Generic, API ) // Check gtestsuite her2.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 6.0; -#endif if (n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 14.1; +#endif thresh = adj*6*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp b/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp index 6669c353a..2ec610a7c 100644 --- a/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp +++ b/gtestsuite/testsuite/level2/symv/dsymv_generic.cpp @@ -82,14 +82,6 @@ TEST_P( dsymvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.4; -#else - double adj = 1.7; - #ifdef REF_IS_MKL - adj = 1.4; - #endif -#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) @@ -97,8 +89,15 @@ TEST_P( dsymvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.5; +#else + double adj = 2.5; +#endif thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp b/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp index 6b4dd5cfb..0fac69494 100644 --- a/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp +++ b/gtestsuite/testsuite/level2/symv/ssymv_generic.cpp @@ -82,14 +82,6 @@ TEST_P( ssymvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 3.4; -#else - double adj = 2.0; - #ifdef REF_IS_MKL - adj = 1.4; - #endif -#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) @@ -97,8 +89,15 @@ TEST_P( ssymvGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 3.4; +#else + double adj = 2.3; +#endif thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp b/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp index e10cea2b2..8b35ad3cd 100644 --- a/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp +++ b/gtestsuite/testsuite/level2/syr2/dsyr2_generic.cpp @@ -79,16 +79,18 @@ TEST_P( dsyr2Generic, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.34; -#else - double adj = 4.0; -#endif if (n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 2.8; +#else + double adj = 4.0; +#endif thresh = adj*6*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp b/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp index b40100c30..f92ccca4b 100644 --- a/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp +++ b/gtestsuite/testsuite/level2/syr2/ssyr2_generic.cpp @@ -79,16 +79,18 @@ TEST_P( ssyr2Generic, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 3.0; -#endif if (n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.4; +#else + double adj = 4.0; +#endif thresh = adj*6*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/trmv/ctrmv/ctrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/ctrmv/ctrmv_generic.cpp index ac9065f5e..795ddcd1e 100644 --- a/gtestsuite/testsuite/level2/trmv/ctrmv/ctrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/ctrmv/ctrmv_generic.cpp @@ -77,20 +77,14 @@ TEST_P( ctrmvGeneric, API ) // Check gtestsuite trmv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 1.0; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else if(alpha == T{1.0}) - thresh = adj*2*n*testinghelpers::getEpsilon(); + thresh = 2*n*testinghelpers::getEpsilon(); else - thresh = adj*3*n*testinghelpers::getEpsilon(); + thresh = 3*n*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call test body using these parameters diff --git a/gtestsuite/testsuite/level2/trmv/dtrmv/dtrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/dtrmv/dtrmv_generic.cpp index 8d090a237..b29f3fb62 100644 --- a/gtestsuite/testsuite/level2/trmv/dtrmv/dtrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/dtrmv/dtrmv_generic.cpp @@ -78,19 +78,13 @@ TEST_P( dtrmvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Threshold adjustment -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 1.0; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else if(alpha == T{1.0}) - thresh = adj*2*n*testinghelpers::getEpsilon(); + thresh = 2*n*testinghelpers::getEpsilon(); else - thresh = adj*3*n*testinghelpers::getEpsilon(); + thresh = 3*n*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call test body using these parameters diff --git a/gtestsuite/testsuite/level2/trmv/strmv/strmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/strmv/strmv_generic.cpp index cae4c44dc..144a606ac 100644 --- a/gtestsuite/testsuite/level2/trmv/strmv/strmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/strmv/strmv_generic.cpp @@ -78,19 +78,13 @@ TEST_P( strmvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Threshold adjustment -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 1.0; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else if(alpha == T{1.0}) - thresh = adj*2*n*testinghelpers::getEpsilon(); + thresh = 2*n*testinghelpers::getEpsilon(); else - thresh = adj*3*n*testinghelpers::getEpsilon(); + thresh = 3*n*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call test body using these parameters diff --git a/gtestsuite/testsuite/level2/trmv/ztrmv/ztrmv_generic.cpp b/gtestsuite/testsuite/level2/trmv/ztrmv/ztrmv_generic.cpp index 3248ec716..f6b89e925 100644 --- a/gtestsuite/testsuite/level2/trmv/ztrmv/ztrmv_generic.cpp +++ b/gtestsuite/testsuite/level2/trmv/ztrmv/ztrmv_generic.cpp @@ -77,20 +77,14 @@ TEST_P( ztrmvGeneric, API ) // Check gtestsuite trmv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 1.0; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else if(alpha == T{1.0}) - thresh = adj*2*n*testinghelpers::getEpsilon(); + thresh = 2*n*testinghelpers::getEpsilon(); else - thresh = adj*3*n*testinghelpers::getEpsilon(); + thresh = 3*n*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call test body using these parameters diff --git a/gtestsuite/testsuite/level2/trsv/ctrsv/ctrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/ctrsv/ctrsv_generic.cpp index b38a731c9..1514512c3 100644 --- a/gtestsuite/testsuite/level2/trsv/ctrsv/ctrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/ctrsv/ctrsv_generic.cpp @@ -77,21 +77,22 @@ TEST_P( ctrsvGeneric, API ) // Check gtestsuite trsv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 1.5; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.5; +#endif if(alpha == T{1.0}) thresh = adj*2*n*testinghelpers::getEpsilon(); else thresh = adj*3*n*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/trsv/dtrsv/dtrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/dtrsv/dtrsv_generic.cpp index cf90ffda0..426bacc4c 100644 --- a/gtestsuite/testsuite/level2/trsv/dtrsv/dtrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/dtrsv/dtrsv_generic.cpp @@ -78,23 +78,21 @@ TEST_P( dtrsvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Threshold adjustment -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 7.5; - #ifdef REF_IS_MKL - adj = 8.3; - #endif -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 7.5; +#endif if(alpha == T{1.0}) thresh = adj*2*n*testinghelpers::getEpsilon(); else thresh = adj*3*n*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/trsv/strsv/strsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/strsv/strsv_generic.cpp index 7af25d85d..b3f433a5a 100644 --- a/gtestsuite/testsuite/level2/trsv/strsv/strsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/strsv/strsv_generic.cpp @@ -78,26 +78,21 @@ TEST_P( strsvGeneric, API ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; - // Threshold adjustment -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 9.0; - #ifdef REF_IS_MKL - adj = 12.0; - #endif -#else - double adj = 12.0; - #ifdef REF_IS_MKL - adj = 14.0; - #endif -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 9.0; +#else + double adj = 18.0; +#endif if(alpha == T{1.0}) thresh = adj*2*n*testinghelpers::getEpsilon(); else thresh = adj*3*n*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level2/trsv/ztrsv/ztrsv_generic.cpp b/gtestsuite/testsuite/level2/trsv/ztrsv/ztrsv_generic.cpp index f9b0a9f87..cf1b9f643 100644 --- a/gtestsuite/testsuite/level2/trsv/ztrsv/ztrsv_generic.cpp +++ b/gtestsuite/testsuite/level2/trsv/ztrsv/ztrsv_generic.cpp @@ -77,21 +77,22 @@ TEST_P( ztrsvGeneric, API ) // Check gtestsuite trsv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; -#ifdef BLIS_INT_ELEMENT_TYPE - double adj = 1.0; -#else - double adj = 2.0; -#endif if (n == 0 || alpha == T{0.0}) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.0; +#endif if(alpha == T{1.0}) thresh = adj*2*n*testinghelpers::getEpsilon(); else thresh = adj*3*n*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemm/cgemm/cgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/cgemm/cgemm_generic.cpp index 759d33231..c5226de2b 100644 --- a/gtestsuite/testsuite/level3/gemm/cgemm/cgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/cgemm/cgemm_generic.cpp @@ -82,7 +82,6 @@ TEST_P( cgemmGeneric, API ) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -90,7 +89,15 @@ TEST_P( cgemmGeneric, API ) (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; else if (alpha == testinghelpers::ZERO()) - thresh = testinghelpers::getEpsilon(); + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.1; +#endif + thresh = adj*testinghelpers::getEpsilon(); + } else thresh = (3*k+1)*testinghelpers::getEpsilon(); diff --git a/gtestsuite/testsuite/level3/gemm/dgemm/dgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/dgemm/dgemm_generic.cpp index b1eff156a..a4f24d03b 100644 --- a/gtestsuite/testsuite/level3/gemm/dgemm/dgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/dgemm/dgemm_generic.cpp @@ -93,9 +93,15 @@ TEST_P( dgemmGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - //thresh = (15*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 3.0; +#else + double adj = 3.2; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemm/sgemm/sgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/sgemm/sgemm_generic.cpp index 5e813582a..3544fd86c 100644 --- a/gtestsuite/testsuite/level3/gemm/sgemm/sgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/sgemm/sgemm_generic.cpp @@ -93,9 +93,15 @@ TEST_P( sgemmGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - //thresh = (24*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 3.9; +#else + double adj = 3.8; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- @@ -194,4 +200,4 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values(0, 17) // increment to the leading dim of c ), ::gemmGenericPrint() - ); \ No newline at end of file + ); diff --git a/gtestsuite/testsuite/level3/gemm/zgemm/zgemm_generic.cpp b/gtestsuite/testsuite/level3/gemm/zgemm/zgemm_generic.cpp index 5f16f11b4..2c7676cea 100644 --- a/gtestsuite/testsuite/level3/gemm/zgemm/zgemm_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm/zgemm/zgemm_generic.cpp @@ -92,9 +92,15 @@ TEST_P( zgemmGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else - thresh = (7*k+3)*testinghelpers::getEpsilon(); - //thresh = (15*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.2; +#else + double adj = 2.5; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemm_compute/IIT_ERS/gemm_compute_IIT_ERS.cpp b/gtestsuite/testsuite/level3/gemm_compute/IIT_ERS/gemm_compute_IIT_ERS.cpp index 8db81df90..de0f0885a 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/IIT_ERS/gemm_compute_IIT_ERS.cpp +++ b/gtestsuite/testsuite/level3/gemm_compute/IIT_ERS/gemm_compute_IIT_ERS.cpp @@ -569,7 +569,39 @@ TYPED_TEST(gemm_compute_IIT_ERS, k_zero_beta_one) } // zero alpha and zero beta - set C to 0 -TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_ZeroBeta) +// Not packing A and not packing B, so alpha is actually one. +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_ZeroBeta_UU) +{ + using T = TypeParam; + + T alpha, beta; + testinghelpers::initzero( alpha ); + testinghelpers::initzero( beta ); + double adj = 2.7; + double thresh = adj*(2*K)*testinghelpers::getEpsilon(); + + // Test with all arguments correct except for the value we are choosing to test. + std::vector a = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, K, LDA); + std::vector b = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', K, N, LDB); + std::vector c = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, N, LDC); + // Copy so that we check that the elements of C are not modified. + std::vector c_ref(c); + + testinghelpers::ref_gemm_compute( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, alpha, + a.data(), LDA, b.data(), LDB, beta, c_ref.data(), LDC ); + + // Enable packing of A matrix to accound for alpha = 0 scaling. + gemm_compute( STORAGE, TRANS, TRANS, 'U', 'U', M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC ); + // Use bitwise comparison (no threshold). + computediff( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC, thresh); + +#ifdef CAN_TEST_INFO_VALUE + gtint_t info = bli_info_get_info_value(); + computediff( "info", info, 0 ); +#endif +} + +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_ZeroBeta_PU) { using T = TypeParam; @@ -596,15 +628,43 @@ TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_ZeroBeta) #endif } +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_ZeroBeta_UP) +{ + using T = TypeParam; + + T alpha, beta; + testinghelpers::initzero( alpha ); + testinghelpers::initzero( beta ); + + std::vector c = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, N, LDC); + // Copy so that we check that the elements of C are not modified. + std::vector zero_mat = testinghelpers::get_random_matrix(0, 0, STORAGE, 'n', M, N, LDB); + + // Test with all arguments correct except for the value we are choosing to test. + std::vector a = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, K, LDA); + std::vector b = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', K, N, LDB); + + // Enable packing of A matrix to accound for alpha = 0 scaling. + gemm_compute( STORAGE, TRANS, TRANS, 'U', 'P', M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC ); + // Use bitwise comparison (no threshold). + computediff( "C", STORAGE, N, N, c.data(), zero_mat.data(), LDC); + +#ifdef CAN_TEST_INFO_VALUE + gtint_t info = bli_info_get_info_value(); + computediff( "info", info, 0 ); +#endif +} + // zero alpha and non-zero/non-unit beta - scale C only -TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_OtherBeta) +// Not packing A and not packing B, so alpha is actually one. +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_OtherBeta_UU) { using T = TypeParam; T alpha, beta; testinghelpers::initzero( alpha ); beta = T{2.0}; - double thresh = testinghelpers::getEpsilon(); + double thresh = (2*K+1)*testinghelpers::getEpsilon(); std::vector a = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, K, LDA); std::vector b = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', K, N, LDB); @@ -626,4 +686,64 @@ TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_OtherBeta) #endif } +// zero alpha and non-zero/non-unit beta - scale C only +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_OtherBeta_PU) +{ + using T = TypeParam; + + T alpha, beta; + testinghelpers::initzero( alpha ); + beta = T{2.0}; + double thresh = testinghelpers::getEpsilon(); + + std::vector a = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, K, LDA); + std::vector b = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', K, N, LDB); + std::vector c = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, N, LDC); + // Copy so that we check that the elements of C are not modified. + std::vector c_ref(c); + + testinghelpers::ref_gemm_compute( STORAGE, TRANS, TRANS, 'P', 'U', M, N, K, alpha, + a.data(), LDA, b.data(), LDB, beta, c_ref.data(), LDC ); + + // Test with all arguments correct except for the value we are choosing to test. + gemm_compute( STORAGE, TRANS, TRANS, 'P', 'U', M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC ); + // Use bitwise comparison (no threshold). + computediff( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC, thresh); + +#ifdef CAN_TEST_INFO_VALUE + gtint_t info = bli_info_get_info_value(); + computediff( "info", info, 0 ); +#endif +} + +// zero alpha and non-zero/non-unit beta - scale C only +TYPED_TEST(gemm_compute_IIT_ERS, ZeroAlpha_OtherBeta_UP) +{ + using T = TypeParam; + + T alpha, beta; + testinghelpers::initzero( alpha ); + beta = T{2.0}; + double thresh = testinghelpers::getEpsilon(); + + std::vector a = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, K, LDA); + std::vector b = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', K, N, LDB); + std::vector c = testinghelpers::get_random_matrix(-10, 10, STORAGE, 'N', M, N, LDC); + // Copy so that we check that the elements of C are not modified. + std::vector c_ref(c); + + testinghelpers::ref_gemm_compute( STORAGE, TRANS, TRANS, 'U', 'P', M, N, K, alpha, + a.data(), LDA, b.data(), LDB, beta, c_ref.data(), LDC ); + + // Test with all arguments correct except for the value we are choosing to test. + gemm_compute( STORAGE, TRANS, TRANS, 'U', 'P', M, N, K, &alpha, a.data(), LDA, b.data(), LDB, &beta, c.data(), LDC ); + // Use bitwise comparison (no threshold). + computediff( "C", STORAGE, N, N, c.data(), c_ref.data(), LDC, thresh); + +#ifdef CAN_TEST_INFO_VALUE + gtint_t info = bli_info_get_info_value(); + computediff( "info", info, 0 ); +#endif +} + #endif diff --git a/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute/dgemm_compute_generic.cpp b/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute/dgemm_compute_generic.cpp index 9c50f8145..e72c7a6df 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute/dgemm_compute_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm_compute/dgemm_compute/dgemm_compute_generic.cpp @@ -91,13 +91,35 @@ TEST_P( dgemmComputeGeneric, API ) double thresh; if (m == 0 || n == 0) thresh = 0.0; - else if ((alpha == testinghelpers::ZERO() || k == 0) && + else if ((k == 0) && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; + else if ((alpha == testinghelpers::ZERO()) && + (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.3; +#endif + if (( packa == 'u' || packa == 'U' ) && + ( packb == 'u' || packb == 'U' )) + // alpha is actually 1.0 when both matrices are unpacked + thresh = adj*(2*k)*testinghelpers::getEpsilon(); + else + thresh = 0.0; + } else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - //thresh = (7*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 2.3; +#else + double adj = 2.7; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute/sgemm_compute_generic.cpp b/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute/sgemm_compute_generic.cpp index 425654512..c5094eb73 100644 --- a/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute/sgemm_compute_generic.cpp +++ b/gtestsuite/testsuite/level3/gemm_compute/sgemm_compute/sgemm_compute_generic.cpp @@ -92,13 +92,35 @@ TEST_P( sgemmComputeGeneric, API ) double thresh; if (m == 0 || n == 0) thresh = 0.0; - else if ((alpha == testinghelpers::ZERO() || k == 0) && + else if ((k == 0) && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; + else if ((alpha == testinghelpers::ZERO()) && + (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 2.7; +#else + double adj = 1.7; +#endif + if (( packa == 'u' || packa == 'U' ) && + ( packb == 'u' || packb == 'U' )) + // alpha is actually 1.0 when both matrices are unpacked + thresh = adj*(2*k)*testinghelpers::getEpsilon(); + else + thresh = 0.0; + } else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - //thresh = (8*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 2.7; +#else + double adj = 3.0; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemmt/cgemmt/cgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/cgemmt/cgemmt_generic.cpp index 394b85916..7a0938320 100644 --- a/gtestsuite/testsuite/level3/gemmt/cgemmt/cgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/cgemmt/cgemmt_generic.cpp @@ -84,7 +84,6 @@ TEST_P( cgemmtGeneric, API ) // Check gtestsuite gemmt.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (n == 0) thresh = 0.0; @@ -92,8 +91,15 @@ TEST_P( cgemmtGeneric, API ) (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.2; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemmt/dgemmt/dgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/dgemmt/dgemmt_generic.cpp index 90a70f667..370909621 100644 --- a/gtestsuite/testsuite/level3/gemmt/dgemmt/dgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/dgemmt/dgemmt_generic.cpp @@ -93,8 +93,15 @@ TEST_P( dgemmtGeneric, API ) (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 4.1; +#else + double adj = 4.0; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemmt/sgemmt/sgemmt_generic.cpp b/gtestsuite/testsuite/level3/gemmt/sgemmt/sgemmt_generic.cpp index fb85774bf..cba180f1b 100644 --- a/gtestsuite/testsuite/level3/gemmt/sgemmt/sgemmt_generic.cpp +++ b/gtestsuite/testsuite/level3/gemmt/sgemmt/sgemmt_generic.cpp @@ -91,8 +91,15 @@ TEST_P( sgemmtGeneric, API ) (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.5; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/gemmt/test_gemmt.h b/gtestsuite/testsuite/level3/gemmt/test_gemmt.h index d28cf4f38..ff94e1d8c 100644 --- a/gtestsuite/testsuite/level3/gemmt/test_gemmt.h +++ b/gtestsuite/testsuite/level3/gemmt/test_gemmt.h @@ -83,7 +83,8 @@ void test_gemmt( char storage, char uploc, char transa, char transb, gtint_t n, dim_t size_c = testinghelpers::matsize(storage, 'n', n, n, ldc) * sizeof(T); testinghelpers::ProtectedBuffer c(size_c, false, is_mem_test ); c_ptr = (T*)c.greenzone_1; - if (beta != testinghelpers::ZERO()) + //if (beta != testinghelpers::ZERO()) + if (1) { testinghelpers::datagenerators::randomgenerators( -3, 5, storage, n, n, c_ptr, 'n', ldc); if ( is_evt_test ) diff --git a/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp b/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp index 9552ef054..b2efcef77 100644 --- a/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp +++ b/gtestsuite/testsuite/level3/hemm/chemm_generic.cpp @@ -86,20 +86,25 @@ TEST_P( chemmGeneric, API ) // Check gtestsuite hemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; - double adj = 2.5; if (m == 0 || n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && (beta == testinghelpers::ZERO() || beta == testinghelpers::ONE())) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.5; +#endif if ( side == 'l' || side == 'L' ) thresh = adj*(3*m+1)*testinghelpers::getEpsilon(); else thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp b/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp index 5bca48ce1..924eb3ca3 100644 --- a/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp +++ b/gtestsuite/testsuite/level3/her2k/cher2k_generic.cpp @@ -83,16 +83,21 @@ TEST_P( cher2kGeneric, API ) // Check gtestsuite her2k.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; - double adj = 2.5; if (n == 0) thresh = 0.0; else if ((alpha == testinghelpers::ZERO() || k == 0) && (beta == 0.0f || beta == 1.0f)) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 5.3; +#endif thresh = adj*(6*k+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp b/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp index 55e1e2539..f73171420 100644 --- a/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp +++ b/gtestsuite/testsuite/level3/her2k/zher2k_generic.cpp @@ -83,16 +83,21 @@ TEST_P( zher2kGeneric, API ) // Check gtestsuite her2k.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; - double adj = 2.5; if (n == 0) thresh = 0.0; else if ((alpha == testinghelpers::ZERO() || k == 0) && (beta == 0.0 || beta == 1.0)) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 3.3; +#endif thresh = adj*(6*k+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/herk/cherk_generic.cpp b/gtestsuite/testsuite/level3/herk/cherk_generic.cpp index fa6b28864..e22398fde 100644 --- a/gtestsuite/testsuite/level3/herk/cherk_generic.cpp +++ b/gtestsuite/testsuite/level3/herk/cherk_generic.cpp @@ -78,15 +78,21 @@ TEST_P( cherkGeneric, API ) // Check gtestsuite herk.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (n == 0) thresh = 0.0; else if ((alpha == 0.0f || k == 0) && (beta == 0.0f || beta == 1.0f)) thresh = 0.0; else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 4.0; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/herk/zherk_generic.cpp b/gtestsuite/testsuite/level3/herk/zherk_generic.cpp index 77e7f393c..4a68f5e1f 100644 --- a/gtestsuite/testsuite/level3/herk/zherk_generic.cpp +++ b/gtestsuite/testsuite/level3/herk/zherk_generic.cpp @@ -78,15 +78,21 @@ TEST_P( zherkGeneric, API ) // Check gtestsuite herk.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (n == 0) thresh = 0.0; else if ((alpha == 0.0 || k == 0) && (beta == 0.0 || beta == 1.0)) thresh = 0.0; else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 4.1; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/symm/csymm_generic.cpp b/gtestsuite/testsuite/level3/symm/csymm_generic.cpp index 66a6a1351..0f49c98cc 100644 --- a/gtestsuite/testsuite/level3/symm/csymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/csymm_generic.cpp @@ -86,9 +86,7 @@ TEST_P( csymmGeneric, API ) // Check gtestsuite symm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // With adjustment for complex data. double thresh; - double adj = 1.5; if (m == 0 || n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() && @@ -97,11 +95,18 @@ TEST_P( csymmGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 3.5; +#endif if ( side == 'l' || side == 'L' ) thresh = adj*(3*m+1)*testinghelpers::getEpsilon(); else thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); - + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp b/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp index 6eec181ac..c053d86f0 100644 --- a/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp +++ b/gtestsuite/testsuite/level3/symm/zsymm_generic.cpp @@ -86,7 +86,6 @@ TEST_P( zsymmGeneric, API ) // Check gtestsuite symm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -96,11 +95,18 @@ TEST_P( zsymmGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.1; +#endif if ( side == 'l' || side == 'L' ) - thresh = (3*m+1)*testinghelpers::getEpsilon(); + thresh = adj*(3*m+1)*testinghelpers::getEpsilon(); else - thresh = (3*n+1)*testinghelpers::getEpsilon(); - + thresh = adj*(3*n+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp b/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp index 5e62c7f2b..d9affa9b5 100644 --- a/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp +++ b/gtestsuite/testsuite/level3/syrk/dsyrk_generic.cpp @@ -86,8 +86,15 @@ TEST_P( dsyrkGeneric, API ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else - thresh = (3*k+1)*testinghelpers::getEpsilon(); - + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 2.4; +#endif + thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp index 062fed57a..ec50ed95f 100644 --- a/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/dtrmm_generic.cpp @@ -85,11 +85,18 @@ TEST_P( dtrmmGeneric, API ) if (m == 0 || n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.5; +#endif if ( side == 'l' || side == 'L' ) - thresh = 3*m*testinghelpers::getEpsilon(); + thresh = adj*3*m*testinghelpers::getEpsilon(); else - thresh = 3*n*testinghelpers::getEpsilon(); - + thresh = adj*3*n*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp b/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp index 4815898ca..3c6c7e27e 100644 --- a/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp +++ b/gtestsuite/testsuite/level3/trmm/strmm_generic.cpp @@ -85,11 +85,18 @@ TEST_P( strmmGeneric, API ) if (m == 0 || n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0; else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.8; +#endif if ( side == 'l' || side == 'L' ) - thresh = 3*m*testinghelpers::getEpsilon(); + thresh = adj*3*m*testinghelpers::getEpsilon(); else - thresh = 3*n*testinghelpers::getEpsilon(); - + thresh = adj*3*n*testinghelpers::getEpsilon(); + } //---------------------------------------------------------- // Call test body using these parameters //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/trsm/dtrsm/dtrsm_generic.cpp b/gtestsuite/testsuite/level3/trsm/dtrsm/dtrsm_generic.cpp index 7e93cf79e..2921b4fbd 100644 --- a/gtestsuite/testsuite/level3/trsm/dtrsm/dtrsm_generic.cpp +++ b/gtestsuite/testsuite/level3/trsm/dtrsm/dtrsm_generic.cpp @@ -234,7 +234,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values('n','u'), // diaga , n=nonunit u=unit ::testing::Values(1, 2, 300, 1500), // n ::testing::Values(1, 2, 300, 1500), // m - ::testing::Values(-2.4, 0.0, 1.0, 3.1, NAN, INFINITY), // alpha + ::testing::Values(-2.4, 0.0, 1.0, 3.1), // alpha ::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 ), diff --git a/gtestsuite/testsuite/level3/trsm/dtrsm/evt/dtrsm_evt.cpp b/gtestsuite/testsuite/level3/trsm/dtrsm/evt/dtrsm_evt.cpp index 870f5909f..864764044 100644 --- a/gtestsuite/testsuite/level3/trsm/dtrsm/evt/dtrsm_evt.cpp +++ b/gtestsuite/testsuite/level3/trsm/dtrsm/evt/dtrsm_evt.cpp @@ -126,7 +126,7 @@ INSTANTIATE_TEST_SUITE_P( ::testing::Values('n','u'), // diaga , n=nonunit u=unit ::testing::Values(1, 2, 301, 1551), // m ::testing::Values(1, 2, 324, 1676), // n - ::testing::Values(-2.4, 0), // alpha + ::testing::Values(-2.4, 1.0, 0.0), // alpha ::testing::Values(gtint_t(0)), // increment to the leading dim of a ::testing::Values(gtint_t(0)), // increment to the leading dim of b ::testing::Values(NO_EVT, NaN, INF, NaN_INF, DIAG_NaN, DIAG_INF),// EVT test for A @@ -134,3 +134,27 @@ INSTANTIATE_TEST_SUITE_P( ), ::trsmEVTPrint() ); + +INSTANTIATE_TEST_SUITE_P( + alpha, + dtrsmEVT, + ::testing::Combine( + ::testing::Values('c' +#ifndef TEST_BLAS_LIKE + ,'r' +#endif + ), // storage format + ::testing::Values('l','r'), // side l:left, r:right + ::testing::Values('u','l'), // uplo u:upper, l:lower + ::testing::Values('n','t'), // transa + ::testing::Values('n','u'), // diaga , n=nonunit u=unit + ::testing::Values(1, 2, 301, 1551), // m + ::testing::Values(1, 2, 324, 1676), // n + ::testing::Values(NaN, INF, -INF), // alpha + ::testing::Values(gtint_t(0)), // increment to the leading dim of a + ::testing::Values(gtint_t(0)), // increment to the leading dim of b + ::testing::Values(NO_EVT), // EVT test for A + ::testing::Values(NO_EVT) // EVT test for B + ), + ::trsmEVTPrint() + ); diff --git a/gtestsuite/testsuite/ukr/gemm/cgemm/cgemm_ukernel.cpp b/gtestsuite/testsuite/ukr/gemm/cgemm/cgemm_ukernel.cpp index 961e27be8..1a52e2430 100644 --- a/gtestsuite/testsuite/ukr/gemm/cgemm/cgemm_ukernel.cpp +++ b/gtestsuite/testsuite/ukr/gemm/cgemm/cgemm_ukernel.cpp @@ -72,8 +72,6 @@ TEST_P( cgemmGenericSUP, UKR ) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // Threshold adjustment - double adj = 8.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -83,8 +81,15 @@ TEST_P( cgemmGenericSUP, UKR ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.4; +#else + double adj = 8.1; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_complex_gemmsup_ukr (storageC, transa, transb, m, n, k, alpha, beta, thresh, kern_ptr, is_memory_test); }// end of function @@ -668,8 +673,6 @@ TEST_P( cgemmGenericNat, UKR ) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // Threshold adjustment - double adj = 8.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -679,8 +682,15 @@ TEST_P( cgemmGenericNat, UKR ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 3.0; +#else + double adj = 7.1; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmnat_ukr(storageC, m, n, k, alpha, beta, thresh, kern_ptr, is_memory_test); }// end of function diff --git a/gtestsuite/testsuite/ukr/gemm/dgemm/dgemm_ukernel.cpp b/gtestsuite/testsuite/ukr/gemm/dgemm/dgemm_ukernel.cpp index 850dbb693..716893305 100644 --- a/gtestsuite/testsuite/ukr/gemm/dgemm/dgemm_ukernel.cpp +++ b/gtestsuite/testsuite/ukr/gemm/dgemm/dgemm_ukernel.cpp @@ -77,7 +77,6 @@ TEST_P( dgemmGenericSUP, sup_kernel) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - double adj = 2.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -87,8 +86,15 @@ TEST_P( dgemmGenericSUP, sup_kernel) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 4.5; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmsup_ukr(kern_ptr, transa, transb, m, n, k, alpha, beta, storageC, MR, row_pref, thresh, is_memory_test); }// end of function @@ -372,7 +378,6 @@ TEST_P( dgemmGenericNat, native_kernel_testing) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - double adj=2.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -382,8 +387,15 @@ TEST_P( dgemmGenericNat, native_kernel_testing) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.1; +#else + double adj = 3.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmnat_ukr(storageC, m, n, k, alpha, beta, kern_ptr, thresh, is_memory_test); }// end of function @@ -505,7 +517,6 @@ TEST_P( dgemmGenericK1, k1_kernel_testing) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. // Threshold adjustment - double adj = 8.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -515,8 +526,15 @@ TEST_P( dgemmGenericK1, k1_kernel_testing) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 1.9; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmk1_ukr(kern_ptr, m, n, k, storageC, alpha, beta, thresh, is_memory_test); }// end of function @@ -638,7 +656,6 @@ TEST_P( dgemmGenericSmall, gemm_small) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. // Threshold adjustment./ - double adj = 2.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -648,11 +665,18 @@ TEST_P( dgemmGenericSmall, gemm_small) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.2; +#else + double adj = 2.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } if ( is_memory_test ) { - srand(time(NULL)); + //srand(time(NULL)); double *a, *b, *c, *cref = NULL; // Allocate memory for A testinghelpers::ProtectedBuffer a_buf( m * k * lda * sizeof(double), false, is_memory_test ); diff --git a/gtestsuite/testsuite/ukr/gemm/sgemm/sgemm_ukernel.cpp b/gtestsuite/testsuite/ukr/gemm/sgemm/sgemm_ukernel.cpp index 64705a529..b69db3496 100644 --- a/gtestsuite/testsuite/ukr/gemm/sgemm/sgemm_ukernel.cpp +++ b/gtestsuite/testsuite/ukr/gemm/sgemm/sgemm_ukernel.cpp @@ -77,7 +77,6 @@ TEST_P( sgemmGenericSUP, functionality_testing) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - double adj = 2.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -87,8 +86,15 @@ TEST_P( sgemmGenericSUP, functionality_testing) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 3.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmsup_ukr(kern_ptr, transa, transb, m, n, k, alpha, beta, storageC, MR, row_pref, thresh, is_memory_test); }// end of function @@ -452,7 +458,6 @@ TEST_P( sgemmGenericNat, functionality_testing) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - double adj = 2.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -462,8 +467,15 @@ TEST_P( sgemmGenericNat, functionality_testing) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.2; +#else + double adj = 4.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmnat_ukr(storageC, m, n, k, alpha, beta, kern_ptr, thresh, is_memory_test); }// end of function diff --git a/gtestsuite/testsuite/ukr/gemm/zgemm/zgemm_ukernel.cpp b/gtestsuite/testsuite/ukr/gemm/zgemm/zgemm_ukernel.cpp index 6588002a1..e6bd10f92 100644 --- a/gtestsuite/testsuite/ukr/gemm/zgemm/zgemm_ukernel.cpp +++ b/gtestsuite/testsuite/ukr/gemm/zgemm/zgemm_ukernel.cpp @@ -73,8 +73,6 @@ TEST_P( zgemmGenericSUP, UKR ) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. - double adj = 20.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -84,8 +82,15 @@ TEST_P( zgemmGenericSUP, UKR ) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 3.6; +#else + double adj = 19.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_complex_gemmsup_ukr(storageC, transa, transb, m, n, k, alpha, beta, thresh, kern_ptr, is_memory_test); }// end of function @@ -1204,7 +1209,6 @@ TEST_P( zgemmGenericNat, MicroKernelTest) // Check gtestsuite gemm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - double adj = 5.0; double thresh; if (m == 0 || n == 0) thresh = 0.0; @@ -1214,8 +1218,15 @@ TEST_P( zgemmGenericNat, MicroKernelTest) else if (alpha == testinghelpers::ZERO()) thresh = testinghelpers::getEpsilon(); else + { + // Threshold adjustment +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.0; +#else + double adj = 5.0; +#endif thresh = adj*(3*k+1)*testinghelpers::getEpsilon(); - + } test_gemmnat_ukr(storageC, m, n, k, alpha, beta, thresh, kern_ptr, is_memory_test); }// end of function diff --git a/gtestsuite/testsuite/ukr/scal2v/zscal2v_ukr.cpp b/gtestsuite/testsuite/ukr/scal2v/zscal2v_ukr.cpp index ca818c550..982bdb7e5 100644 --- a/gtestsuite/testsuite/ukr/scal2v/zscal2v_ukr.cpp +++ b/gtestsuite/testsuite/ukr/scal2v/zscal2v_ukr.cpp @@ -73,12 +73,17 @@ TEST_P( zscal2vGeneric, UKR ) // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. double thresh; +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.01; +#else + double adj = 1.0; +#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() || alpha == testinghelpers::ONE()) thresh = 0.0; else - thresh = testinghelpers::getEpsilon(); + thresh = adj*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call generic test body using those parameters diff --git a/gtestsuite/testsuite/ukr/scalv/cscalv_ukr.cpp b/gtestsuite/testsuite/ukr/scalv/cscalv_ukr.cpp index d802b47b0..7a556c867 100644 --- a/gtestsuite/testsuite/ukr/scalv/cscalv_ukr.cpp +++ b/gtestsuite/testsuite/ukr/scalv/cscalv_ukr.cpp @@ -71,14 +71,18 @@ TEST_P( cscalvGeneric, UKR ) // Check gtestsuite scalv.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; +#ifdef BLIS_INT_ELEMENT_TYPE + double adj = 1.01; +#else + double adj = 1.0; +#endif if (n == 0) thresh = 0.0; else if (alpha == testinghelpers::ZERO() || alpha == testinghelpers::ONE()) thresh = 0.0; else - thresh = testinghelpers::getEpsilon(); + thresh = adj*testinghelpers::getEpsilon(); //---------------------------------------------------------- // Call generic test body using those parameters diff --git a/gtestsuite/testsuite/ukr/trsm/ztrsm/ztrsm_ukr.cpp b/gtestsuite/testsuite/ukr/trsm/ztrsm/ztrsm_ukr.cpp index 774a5fa4a..ac855fba5 100644 --- a/gtestsuite/testsuite/ukr/trsm/ztrsm/ztrsm_ukr.cpp +++ b/gtestsuite/testsuite/ukr/trsm/ztrsm/ztrsm_ukr.cpp @@ -87,13 +87,12 @@ TEST_P( ztrsmGenericNat, UKR ) // Check gtestsuite trsm.h or netlib source code for reminder of the // functionality from which we estimate operation count per element // of output, and hence the multipler for epsilon. - // No adjustment applied yet for complex data. double thresh; // Threshold adjustment #ifdef BLIS_INT_ELEMENT_TYPE double adj = 1.0; #else - double adj = 1.6; + double adj = 1.7; #endif if (m == 0 || n == 0 || alpha == testinghelpers::ZERO()) thresh = 0.0;