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 <Sangadala.Eswari@amd.com>
AMD-Internal: CPUPL-4414
Change-Id: I6fba26a35903d1f6dbd713f19eac6bb537b3d8d2
This commit is contained in:
eseswari
2024-04-16 09:58:03 +05:30
committed by Eswari Eswari
parent 7bd87e3057
commit 34422757fa
4 changed files with 369 additions and 0 deletions

View File

@@ -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()
);

View File

@@ -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()
);

View File

@@ -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()
);

View File

@@ -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()
);