From 34422757fa9d7ef3cdb82bfd448b643ae5751a77 Mon Sep 17 00:00:00 2001 From: eseswari Date: Tue, 16 Apr 2024 09:58:03 +0530 Subject: [PATCH] Added testcases for GER API : *covered large sizes, scalar combinations and strides greater than the size for cger, dger, sger and zger. Signed-off-by: Sangadala Eswari AMD-Internal: CPUPL-4414 Change-Id: I6fba26a35903d1f6dbd713f19eac6bb537b3d8d2 --- .../testsuite/level2/ger/cger_generic.cpp | 94 +++++++++++++++++++ .../testsuite/level2/ger/dger_generic.cpp | 93 ++++++++++++++++++ .../testsuite/level2/ger/sger_generic.cpp | 91 ++++++++++++++++++ .../testsuite/level2/ger/zger_generic.cpp | 91 ++++++++++++++++++ 4 files changed, 369 insertions(+) diff --git a/gtestsuite/testsuite/level2/ger/cger_generic.cpp b/gtestsuite/testsuite/level2/ger/cger_generic.cpp index e1e5a915c..510b38147 100644 --- a/gtestsuite/testsuite/level2/ger/cger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/cger_generic.cpp @@ -257,3 +257,97 @@ INSTANTIATE_TEST_SUITE_P( ::cgerGenericTestPrint() ); #endif + +INSTANTIATE_TEST_SUITE_P( + scalarCombinations, + cgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // conjy: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // m + ::testing::Values( gtint_t(35) ), + // n + ::testing::Values( gtint_t(40) ), + // alpha: value of scalar + ::testing::Values( scomplex{-100.0, 200.0}, scomplex{200.0, 100.0}, scomplex{-175.0, -143.0},scomplex{187.0, -275.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(2) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(3) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(2) ) + ), + ::cgerGenericTestPrint() + ); +//large values of m and n +INSTANTIATE_TEST_SUITE_P( + largeSize, + cgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // conjy: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // m + ::testing::Values( gtint_t(3500) ), + // n + ::testing::Values( gtint_t(4000) ), + // alpha: value of scalar + ::testing::Values( scomplex{-10.0, 8.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(2), gtint_t(1) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(3), gtint_t(1) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(2) ) + ), + ::cgerGenericTestPrint() + ); +//Stride greater than m and n +INSTANTIATE_TEST_SUITE_P( + strideGreaterThanSize, + cgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // conjy: use n for no_conjugate and c for conjugate. + ::testing::Values( 'c' ), + // m + ::testing::Values( gtint_t(3) ), + // n + ::testing::Values( gtint_t(4) ), + // alpha: value of scalar + ::testing::Values( scomplex{-10.0, 8.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(15) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(18) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(20) ) + ), + ::cgerGenericTestPrint() + ); + diff --git a/gtestsuite/testsuite/level2/ger/dger_generic.cpp b/gtestsuite/testsuite/level2/ger/dger_generic.cpp index 998e964be..02a0b5e1c 100644 --- a/gtestsuite/testsuite/level2/ger/dger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/dger_generic.cpp @@ -252,3 +252,96 @@ INSTANTIATE_TEST_SUITE_P( ::dgerGenericTestPrint() ); #endif + +INSTANTIATE_TEST_SUITE_P( + scalarCombinations, + dgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(3) ), + // n + ::testing::Values( gtint_t(3) ), + // alpha: value of scalar + ::testing::Values( double(-500.1), double(1000.0), double(48.3) ), + // incx: stride of x vector. + ::testing::Values( gtint_t(3) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(1) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(2) ) + ), + ::dgerGenericTestPrint() + ); +//large size for m and n +INSTANTIATE_TEST_SUITE_P( + largeSize, + dgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(3000) ), + // n + ::testing::Values( gtint_t(2500) ), + // alpha: value of scalar + ::testing::Values( double(5.1) ), + // incx: stride of x vector. + ::testing::Values( gtint_t(3),gtint_t(1) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(4),gtint_t(1) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(2) ) + ), + ::dgerGenericTestPrint() + ); +//incx and incy are greater than m and n. +INSTANTIATE_TEST_SUITE_P( + strideGreaterThanSize, + dgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(3) ), + // n + ::testing::Values( gtint_t(2) ), + // alpha: value of scalar + ::testing::Values( double(5.1) ), + // incx: stride of x vector. + ::testing::Values( gtint_t(10) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(15) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(7) ) + ), + ::dgerGenericTestPrint() + ); diff --git a/gtestsuite/testsuite/level2/ger/sger_generic.cpp b/gtestsuite/testsuite/level2/ger/sger_generic.cpp index df734360b..af4a1bc89 100644 --- a/gtestsuite/testsuite/level2/ger/sger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/sger_generic.cpp @@ -257,3 +257,94 @@ INSTANTIATE_TEST_SUITE_P( ::sgerGenericTestPrint() ); #endif + +INSTANTIATE_TEST_SUITE_P( + scalarCombinations, + sgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(5) ), + // n + ::testing::Values( gtint_t(4) ), + // alpha: value of scalar + ::testing::Values( float(-401.1), float(100.0), float(3.4)), + // incx: stride of x vector. + ::testing::Values( gtint_t(2) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(3) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(1) ) + ), + ::sgerGenericTestPrint() + ); +INSTANTIATE_TEST_SUITE_P( + largeSize, + sgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(5000) ), + // n + ::testing::Values( gtint_t(4000) ), + // alpha: value of scalar + ::testing::Values( float(3.4) ), + // incx: stride of x vector. + ::testing::Values( gtint_t(2), gtint_t(1) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(3), gtint_t(1) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(1) ) + ), + ::sgerGenericTestPrint() + ); +INSTANTIATE_TEST_SUITE_P( + strideGreaterThanSize, + sgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(2) ), + // n + ::testing::Values( gtint_t(4) ), + // alpha: value of scalar + ::testing::Values( float(3.4)), + // incx: stride of x vector. + ::testing::Values( gtint_t(10) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(15) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(9) ) + ), + ::sgerGenericTestPrint() + ); \ No newline at end of file diff --git a/gtestsuite/testsuite/level2/ger/zger_generic.cpp b/gtestsuite/testsuite/level2/ger/zger_generic.cpp index e6edbb6f2..94534f9d2 100644 --- a/gtestsuite/testsuite/level2/ger/zger_generic.cpp +++ b/gtestsuite/testsuite/level2/ger/zger_generic.cpp @@ -257,3 +257,94 @@ INSTANTIATE_TEST_SUITE_P( ::zgerGenericTestPrint() ); #endif + +INSTANTIATE_TEST_SUITE_P( + scalarCombinations, + zgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(2) ), + // n + ::testing::Values( gtint_t(3) ), + // alpha: value of scalar + ::testing::Values( dcomplex{-102.0, 404.0}, dcomplex{172.0, 138.0}, dcomplex{303.0, -267.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(2) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(3) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(1) ) + ), + ::zgerGenericTestPrint() + ); +INSTANTIATE_TEST_SUITE_P( + largeSize, + zgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(1111) ), + // n + ::testing::Values( gtint_t(3333) ), + // alpha: value of scalar + ::testing::Values( dcomplex{2.0, 4.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(3), gtint_t(1) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(4), gtint_t(1) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(1) ) + ), + ::zgerGenericTestPrint() + ); +INSTANTIATE_TEST_SUITE_P( + strideGreaterThanSize, + zgerGenericTest, + ::testing::Combine( + // storage scheme: row/col-stored matrix + ::testing::Values( 'c' + // row-stored tests are disabled for BLAS since BLAS only supports col-storage scheme. +#ifndef TEST_BLAS + , 'r' +#endif + ), + // conjx: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // conjy: uses n (no_conjugate) since it is real. + ::testing::Values( 'n' ), + // m + ::testing::Values( gtint_t(1) ), + // n + ::testing::Values( gtint_t(3) ), + // alpha: value of scalar + ::testing::Values( dcomplex{2.0, 4.0} ), + // incx: stride of x vector. + ::testing::Values( gtint_t(11) ), + // incy: stride of y vector. + ::testing::Values( gtint_t(22) ), + // inc_lda: increment to the leading dim of a + ::testing::Values( gtint_t(9) ) + ), + ::zgerGenericTestPrint() + ); \ No newline at end of file