diff --git a/gtestsuite/testinghelpers/inc/common/testing_basics.h b/gtestsuite/testinghelpers/inc/common/testing_basics.h index 3176562a7..df2c77059 100644 --- a/gtestsuite/testinghelpers/inc/common/testing_basics.h +++ b/gtestsuite/testinghelpers/inc/common/testing_basics.h @@ -195,8 +195,8 @@ bool chkconj( char trans ); * @param uplo specifies whether matrix is upper or lower triangular stored in memory. * @return boolean of the triangular form of the matrix. */ -bool chkupper( char uplo ); -bool chklower( char uplo ); +bool is_upper_triangular( char uplo ); +bool is_lower_triangular( char uplo ); /** * @brief Returns the boolean form of a matrix unit/non-unit diagonal form. @@ -275,4 +275,100 @@ void set_dims( char trans, gtint_t m, gtint_t n, gtint_t* mt, gtint_t* nt ); */ void set_dim_with_side( char side, gtint_t m, gtint_t n, gtint_t* dim ); +/** + * ========================================================================== + * MKHERM + * Make an n x n matrix A explicitly Hermitian by copying the conjugate + * of the triangle specified by uploa to the opposite triangle. Imaginary + * components of diagonal elements are explicitly set to zero. + * It is assumed that the diagonal offset of A is zero. + * ========================================================================== + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] uplo specifies upper or lower triangular part of A is used. + * @param[in] n specifies the number of rows & columns of square matrix. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + */ +template +void make_herm( char storage, char uplo, gtint_t n, T* a, gtint_t ld ); + +/** + * ========================================================================== + * MKSYMM + * Make an n x n matrix A explicitly symmetric by copying the triangle + * specified by uploa to the opposite triangle. + * It is assumed that the diagonal offset of A is zero. + * ========================================================================== + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] uplo specifies upper or lower triangular part of A is used. + * @param[in] n specifies the number of rows & columns of square matrix. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + */ +template +void make_symm( char storage, char uplo, gtint_t n, T* a, gtint_t ld ); + +/** + * ========================================================================== + * MKTRIM + * Make an n x n matrix A explicitly triangular by preserving the triangle + * specified by uploa and zeroing the elements in the opposite triangle. + * It is assumed that the diagonal offset of A is zero + * ========================================================================== + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] uplo specifies upper or lower triangular part of A is used. + * @param[in] n specifies the number of rows & columns of square matrix. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + */ +template +void make_triangular( char storage, char uplo, gtint_t n, T* a, gtint_t ld ); + +/** + * ========================================================================== + * MKDIAG + * Make an m x n matrix A, which adds a scalar value to + * every element along an arbitrary diagonal of a matrix. + * It is assumed that the diagonal offset of A is zero + * ========================================================================== + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] m specifies the number of rows of a given matrix. + * @param[in] n specifies the number of columns of a given matrix. + * @param[in] alpha specifies the value to set diagonal elements. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + */ +template +void make_diag( char storage, gtint_t m, gtint_t n, T alpha, T *a, gtint_t ld ); + +/** + * print scalar value + * @param[in] x specifies the value. + * @param[in] spec specifies the format specifer. + */ +template +void print_scalar( T x, const char *spec ); + +/** + * print vector of length n + * @param[in] n specifies the length of the given vector. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] incx specifies storage spacing between elements of a. + * @param[in] spec specifies the format specifer. + */ +template +void print_vector( const char *vec, gtint_t n, T *x, gtint_t incx, const char *spec ); + +/** + * print matrix of size m x n + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] m specifies the number of rows of given matrix. + * @param[in] n specifies the number of columns of given matrix. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + * @param[in] spec specifies the format specifer. + */ +template +void print_matrix( const char *mat, char storage, gtint_t m, gtint_t n, T *a, gtint_t ld, const char *spec ); + } //end of namespace testinghelpers diff --git a/gtestsuite/testinghelpers/src/common/testing_basics.cpp b/gtestsuite/testinghelpers/src/common/testing_basics.cpp index 2d0707271..53c105079 100644 --- a/gtestsuite/testinghelpers/src/common/testing_basics.cpp +++ b/gtestsuite/testinghelpers/src/common/testing_basics.cpp @@ -34,6 +34,7 @@ #include "common/testing_basics.h" #include "common/type_info.h" +#include "common/complex_helpers.h" namespace testinghelpers { @@ -91,7 +92,6 @@ void char_to_cblas_order( char order, CBLAS_ORDER *cblas_order ) { if ( order == 'c' || order == 'C' ) *cblas_order = CblasColMajor; else if ( order == 'r' || order == 'R' ) *cblas_order = CblasRowMajor; - } void char_to_cblas_trans( char trans, CBLAS_TRANSPOSE *cblas_trans ) @@ -160,16 +160,16 @@ gtint_t get_leading_dimension( char storage, char trans, gtint_t m, gtint_t n, g if( (storage == 'c') || (storage == 'C') ) //column-major order { if ((trans == 'n')||(trans == 'N')) - lda = std::max(gtint_t(1),m) + inc; + lda = (std::max)(gtint_t(1),m) + inc; else - lda = std::max(gtint_t(1),n) + inc; + lda = (std::max)(gtint_t(1),n) + inc; } else //row-major order { if ((trans == 'n')||(trans == 'N')) - lda = std::max(gtint_t(1),n) + inc; + lda = (std::max)(gtint_t(1),n) + inc; else - lda = std::max(gtint_t(1),m) + inc; + lda = (std::max)(gtint_t(1),m) + inc; } return lda; } @@ -249,14 +249,14 @@ bool chkconj( char conjx ) ( ( conj & BLIS_CONJ_BIT ) == BLIS_BITVAL_CONJ ); } -bool chkupper( char uplo ) +bool is_upper_triangular( char uplo ) { uplo_t uploa; char_to_blis_uplo( uplo, &uploa ); return ( bool ) ( uploa == BLIS_UPPER ); } -bool chklower( char uplo ) +bool is_lower_triangular( char uplo ) { uplo_t uploa; char_to_blis_uplo( uplo, &uploa ); @@ -326,4 +326,292 @@ void set_dim_with_side( char side, gtint_t m, gtint_t n, gtint_t* dim ) else *dim = n; } -} //end of namespace testinghelpers +template +static void set_imag_zero(T &x){ + x = {x.real, 0.0}; +} + +/** + * ========================================================================== + * MKHERM + * Make an n x n matrix A explicitly Hermitian by copying the conjugate + * of the triangle specified by uploa to the opposite triangle. Imaginary + * components of diagonal elements are explicitly set to zero. + * It is assumed that the diagonal offset of A is zero. + * ========================================================================== + */ +template +void make_herm( char storage, char uplo, gtint_t n, T* a, gtint_t ld ) +{ + gtint_t rs,cs; + rs=cs=1; + /* a = n x n */ + if( (storage == 'c') || (storage == 'C') ) + cs = ld ; + else + rs = ld ; + + bool uploa = testinghelpers::is_upper_triangular( uplo ); + + if( uploa ) { + gtint_t i, j; + for ( j = 0; j < ( n-1) ; j++ ) + { + for ( i = (j+1) ; i < n ; i++ ) + { + a[i*rs + j*cs] = testinghelpers::conj(a[i*cs + j*rs]); + } + } + } + else + { + gtint_t i, j; + for ( j = 1; j < n ; j++ ) + { + for ( i = 0 ; i < j ; i++ ) + { + a[i*rs + j*cs] = testinghelpers::conj(a[i*cs + j*rs]); + } + } + } + if constexpr (testinghelpers::type_info::is_complex) { + gtint_t i; + for ( i = 0; i < n ; i++ ) + { + set_imag_zero(a[i*rs + i*cs]); + } + } +} +template void make_herm( char, char, gtint_t, float *, gtint_t ); +template void make_herm( char, char, gtint_t, double *, gtint_t ); +template void make_herm( char, char, gtint_t, scomplex *, gtint_t ); +template void make_herm( char, char, gtint_t, dcomplex *, gtint_t ); + +/** + * ========================================================================== + * MKSYMM + * Make an n x n matrix A explicitly symmetric by copying the triangle + * specified by uploa to the opposite triangle. + * It is assumed that the diagonal offset of A is zero. + * ========================================================================== + */ +template +void make_symm( char storage, char uplo, gtint_t n, T* a, gtint_t ld ) +{ + gtint_t rs,cs; + rs=cs=1; + /* a = n x n */ + if( (storage == 'c') || (storage == 'C') ) + cs = ld ; + else + rs = ld ; + + bool uploa = testinghelpers::is_upper_triangular( uplo ); + + /* Toggle uplo so that it refers to the unstored triangle. */ + if( uploa ) { + gtint_t i, j; + for ( j = 0; j < ( n-1) ; j++ ) + { + for ( i = (j+1) ; i < n ; i++ ) + { + a[i*rs + j*cs] = a[i*cs + j*rs]; + } + } + } + else + { + gtint_t i, j; + for ( j = 1; j < n ; j++ ) + { + for ( i = 0 ; i < j ; i++ ) + { + a[i*rs + j*cs] = a[i*cs + j*rs]; + } + } + } +} +template void make_symm( char, char, gtint_t, float *, gtint_t ); +template void make_symm( char, char, gtint_t, double *, gtint_t ); +template void make_symm( char, char, gtint_t, scomplex *, gtint_t ); +template void make_symm( char, char, gtint_t, dcomplex *, gtint_t ); + +/** + * ========================================================================== + * MKTRIM + * Make an n x n matrix A explicitly triangular by preserving the triangle + * specified by uploa and zeroing the elements in the opposite triangle. + * It is assumed that the diagonal offset of A is zero + * ========================================================================== + */ +template +void make_triangular( char storage, char uplo, gtint_t n, T* a, gtint_t ld ) +{ + gtint_t rs,cs; + rs=cs=1; + /* a = n x n */ + if( (storage == 'c') || (storage == 'C') ) + cs = ld ; + else + rs = ld ; + + if ( n < 0 ) + return; + + bool uploa = testinghelpers::is_upper_triangular( uplo ); + T zero; + testinghelpers::initzero(zero); + + /* Toggle uplo so that it refers to the unstored triangle. */ + if( !uploa ) { + gtint_t i, j; + for ( j = 1; j < n ; j++ ) + { + for ( i = 0 ; i < j ; i++ ) + { + a[i*rs + j*cs] = zero; + } + } + } + else + { + gtint_t i, j; + for ( j = 0; j < ( n-1) ; j++ ) + { + for ( i = (j+1) ; i < n ; i++ ) + { + a[i*rs + j*cs] = zero; + } + } + } +} +template void make_triangular( char, char, gtint_t, float *, gtint_t ); +template void make_triangular( char, char, gtint_t, double *, gtint_t ); +template void make_triangular( char, char, gtint_t, scomplex *, gtint_t ); +template void make_triangular( char, char, gtint_t, dcomplex *, gtint_t ); + +/** + * ========================================================================== + * MKDIAG + * Make an m x n matrix A, which adds a scalar value to + * every element along an arbitrary diagonal of a matrix. + * It is assumed that the diagonal offset of A is zero + * ========================================================================== + */ +template +void make_diag( char storage, gtint_t m, gtint_t n, T alpha, T *a, gtint_t ld ) +{ + gtint_t rs,cs; + rs=cs=1; + + if( (storage == 'c') || (storage == 'C') ) + cs = ld ; + else + rs = ld ; + + /* a = mn x mn */ + gtint_t mn = (std::min)( n , m ); + + gtint_t i; + gtint_t inca = rs + cs ; + T *ap = a; + gtint_t ia = 0; + for ( i = 0; i < mn; i++ ) + { + ap[ia] = (alpha + ap[ia]); + ia = ia + inca; + } +} +template void make_diag( char, gtint_t, gtint_t, float, float *, gtint_t ); +template void make_diag( char, gtint_t, gtint_t, double, double *, gtint_t ); +template void make_diag( char, gtint_t, gtint_t, scomplex, scomplex *, gtint_t ); +template void make_diag( char, gtint_t, gtint_t, dcomplex, dcomplex *, gtint_t ); + +/** + * print scalar value + * @param[in] x specifies the value. + * @param[in] spec specifies the format specifer. + */ +template +void print_scalar( T x, const char *spec ) { + if constexpr (testinghelpers::type_info::is_real) + printf(spec, x); + else { + printf( spec, x.real ); + if(x.imag < 0) printf( "-" ); + else printf( "+" ); + printf( spec, abs(x.imag) ); + printf( " " ); + } +} +template void print_scalar( float x, const char * ); +template void print_scalar( double x, const char * ); +template void print_scalar( scomplex x, const char * ); +template void print_scalar( dcomplex x, const char * ); + +/** + * print vector of length n + * @param[in] n specifies the length of the given vector. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] incx specifies storage spacing between elements of a. + * @param[in] spec specifies the format specifer. + */ +template +void print_vector( gtint_t n, T *x, gtint_t incx, const char *spec ) +{ + gtint_t i, idx; + T val; + + for ( i = 0; i < n; i++ ) + { + idx = (incx > 0) ? (i * incx) : ( - ( n - i - 1 ) * incx ); + val = x[idx]; + print_scalar(val,spec); + printf( " " ); + } + printf( "\n\n" ); +} +template void print_vector( gtint_t, float *, gtint_t, const char * ); +template void print_vector( gtint_t, double *, gtint_t, const char * ); +template void print_vector( gtint_t, scomplex *, gtint_t, const char * ); +template void print_vector( gtint_t, dcomplex *, gtint_t, const char * ); + +/** + * print matrix of size m x n + * @param[in] storage specifies the storage format of matrix in memory. + * @param[in] m specifies the number of rows of given matrix. + * @param[in] n specifies the number of columns of given matrix. + * @param[in] a specifies pointer which points to the first element of a. + * @param[in] ld specifies leading dimension for a given matrix. + * @param[in] spec specifies the format specifer. + */ +template +void print_matrix( char storage, gtint_t m, gtint_t n, T *a, gtint_t ld, const char *spec ) +{ + gtint_t rs,cs; + rs=cs=1; + T val; + if( (storage == 'c') || (storage == 'C') ) + cs = ld ; + else + rs = ld ; + + gtint_t i, j; + for ( i = 0; i < m; i++ ) + { + for ( j = 0; j < n; j++ ) + { + val = a[i*rs + j*cs]; + print_scalar(val,spec); + printf( " " ); + } + printf( "\n" ); + } + printf( "\n" ); +} +template void print_matrix( char, gtint_t, gtint_t, float *, gtint_t, const char * ); +template void print_matrix( char, gtint_t, gtint_t, double *, gtint_t, const char * ); +template void print_matrix( char, gtint_t, gtint_t, scomplex *, gtint_t, const char * ); +template void print_matrix( char, gtint_t, gtint_t, dcomplex *, gtint_t, const char * ); + +} //end of namespace testinghelpers \ No newline at end of file diff --git a/gtestsuite/testinghelpers/src/level3/ref_trmm3.cpp b/gtestsuite/testinghelpers/src/level3/ref_trmm3.cpp index 8f409773f..2633b63b4 100644 --- a/gtestsuite/testinghelpers/src/level3/ref_trmm3.cpp +++ b/gtestsuite/testinghelpers/src/level3/ref_trmm3.cpp @@ -64,7 +64,7 @@ void ref_trmm3( char storage, char side, char uploa, char trnsa, char diaga, //* Test the input parameters. bool lside = ( testinghelpers::chksideleft( side ) ); - bool upper = ( testinghelpers::chkupper( uploa ) ); + bool upper = ( testinghelpers::is_upper_triangular( uploa ) ); bool unitdg = ( testinghelpers::chkunitdiag( diaga ) ); bool transa = ( testinghelpers::chktrans( trnsa ) ); bool transb = ( testinghelpers::chktrans( trnsb ) ); diff --git a/gtestsuite/testsuite/inc/utils.h b/gtestsuite/testsuite/inc/utils.h deleted file mode 100644 index ded4e98f9..000000000 --- a/gtestsuite/testsuite/inc/utils.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - - BLIS - An object-based framework for developing high-performance BLAS-like - libraries. - - Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name(s) of the copyright holder(s) nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#pragma once - -#pragma once -#include "blis.h" -#include "common/testing_helpers.h" - -/* - * ========================================================================== - * MKHERM - * Make an m x m matrix A explicitly Hermitian by copying the conjugate - * of the triangle specified by uploa to the opposite triangle. Imaginary - * components of diagonal elements are explicitly set to zero. - * It is assumed that the diagonal offset of A is zero. - * ========================================================================== - */ -template -static void mkherm( char storage, char uplo, gtint_t n, T* ap, gtint_t lda ) -{ - uplo_t uploa; - - // Map parameter characters to BLIS constants. - testinghelpers::char_to_blis_uplo ( uplo, &uploa ); - - dim_t rsa,csa; - rsa=csa=1; - /* a = n x n */ - if( (storage == 'c') || (storage == 'C') ) - csa = lda ; - else - rsa = lda ; - - if constexpr (std::is_same::value) - bli_smkherm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_dmkherm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_cmkherm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_zmkherm( uploa, n, ap, rsa, csa ); - else - - throw std::runtime_error("Error in utils.h: Invalid typename in mkherm()."); -} - -/* - * ========================================================================== - * MKSYMM - * Make an m x m matrix A explicitly symmetric by copying the triangle - * specified by uploa to the opposite triangle. - * It is assumed that the diagonal offset of A is zero. - * ========================================================================== - */ - -template -static void mksymm( char storage, char uplo, gtint_t n, T* ap, gtint_t lda ) -{ - uplo_t uploa; - - // Map parameter characters to BLIS constants. - testinghelpers::char_to_blis_uplo ( uplo, &uploa ); - - dim_t rsa,csa; - rsa=csa=1; - /* a = n x n */ - if( (storage == 'c') || (storage == 'C') ) - csa = lda ; - else - rsa = lda ; - - if constexpr (std::is_same::value) - bli_smksymm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_dmksymm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_cmksymm( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_zmksymm( uploa, n, ap, rsa, csa ); - else - - throw std::runtime_error("Error in utils.h: Invalid typename in mksymm()."); -} - -/* - * ========================================================================== - * MKTRIM - * Make an m x m matrix A explicitly triangular by preserving the triangle - * specified by uploa and zeroing the elements in the opposite triangle. - * It is assumed that the diagonal offset of A is zero - * ========================================================================== - */ -template -static void mktrim( char storage, char uplo, gtint_t n, T* ap, gtint_t lda ) -{ - uplo_t uploa; - - // Map parameter characters to BLIS constants. - testinghelpers::char_to_blis_uplo ( uplo, &uploa ); - - dim_t rsa,csa; - rsa=csa=1; - /* a = n x n */ - if( (storage == 'c') || (storage == 'C') ) - csa = lda ; - else - rsa = lda ; - - if constexpr (std::is_same::value) - bli_smktrim( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_dmktrim( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_cmktrim( uploa, n, ap, rsa, csa ); - else if constexpr (std::is_same::value) - bli_zmktrim( uploa, n, ap, rsa, csa ); - else - - throw std::runtime_error("Error in utils.h: Invalid typename in mktrim()."); -} - -template -static void print( T x, const char *spec ) { - if constexpr (testinghelpers::type_info::is_real) - printf(spec, x); - else { - printf( spec, x.real ); - if(x.imag < 0) printf( " -" ); - else printf( " +" ); - printf( spec, abs(x.imag) ); - printf( " " ); - } -} - -template -void printmat( const char *mat, char storage, gtint_t m, gtint_t n, T *a, gtint_t ld, const char *spec ) -{ - dim_t i, j; - dim_t rs,cs; - rs=cs=1; - T val; - if( (storage == 'c') || (storage == 'C') ) - cs = ld ; - else - rs = ld ; - - std::cout <<"matrix : " << mat << std::endl; - - for ( i = 0; i < m; i++ ) - { - for ( j = 0; j < n; j++ ) - { - val = a[i*rs + j*cs]; - print(val,spec); - printf( " " ); - } - printf( "\n" ); - } - printf( "\n" ); -} - -template -void printvec( const char *vec, gtint_t n, T *x, gtint_t incx, const char *spec ) -{ - dim_t i, idx; - T val; - - std::cout <<"vector : " << vec << std::endl; - - for ( i = 0; i < n; i++ ) - { - idx = (incx > 0) ? (i * incx) : ( - ( n - i - 1 ) * incx ); - val = x[idx]; - print(val,spec); - printf( " " ); - } - printf( "\n\n" ); -} - diff --git a/gtestsuite/testsuite/level2/hemv/test_hemv.h b/gtestsuite/testsuite/level2/hemv/test_hemv.h index 4985c4644..a5018701a 100644 --- a/gtestsuite/testsuite/level2/hemv/test_hemv.h +++ b/gtestsuite/testsuite/level2/hemv/test_hemv.h @@ -37,7 +37,6 @@ #include "hemv.h" #include "level2/ref_hemv.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -55,8 +54,8 @@ void test_hemv( char storage, char uploa, char conja, char conjx, gtint_t n, std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); std::vector y = testinghelpers::get_random_vector( -3, 3, n, incy ); - mkherm( storage, uploa, n, a.data(), lda ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_herm( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector y_ref(y); diff --git a/gtestsuite/testsuite/level2/her/test_her.h b/gtestsuite/testsuite/level2/her/test_her.h index 6e18e0481..b0975b2ad 100644 --- a/gtestsuite/testsuite/level2/her/test_her.h +++ b/gtestsuite/testsuite/level2/her/test_her.h @@ -37,7 +37,6 @@ #include "her.h" #include "level2/ref_her.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -54,7 +53,7 @@ void test_her( char storage, char uploa, char conjx, gtint_t n, Tr alpha, std::vector a = testinghelpers::get_random_matrix( -2, 5, storage, 'n', n, n, lda ); std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector a_ref(a); diff --git a/gtestsuite/testsuite/level2/her2/test_her2.h b/gtestsuite/testsuite/level2/her2/test_her2.h index f896e89ca..487454ae9 100644 --- a/gtestsuite/testsuite/level2/her2/test_her2.h +++ b/gtestsuite/testsuite/level2/her2/test_her2.h @@ -37,7 +37,6 @@ #include "her2.h" #include "level2/ref_her2.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -55,8 +54,8 @@ void test_her2( char storage, char uploa, char conjx, char conjy, gtint_t n, std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); std::vector y = testinghelpers::get_random_vector( -2, 5, n, incy ); - mkherm( storage, uploa, n, a.data(), lda ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_herm( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector a_ref(a); diff --git a/gtestsuite/testsuite/level2/symv/test_symv.h b/gtestsuite/testsuite/level2/symv/test_symv.h index a808060d5..789caecba 100644 --- a/gtestsuite/testsuite/level2/symv/test_symv.h +++ b/gtestsuite/testsuite/level2/symv/test_symv.h @@ -37,7 +37,6 @@ #include "symv.h" #include "level2/ref_symv.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -55,8 +54,8 @@ void test_symv( char storage, char uploa, char conja, char conjx, gtint_t n, std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); std::vector y = testinghelpers::get_random_vector( -2, 5, n, incy ); - mksymm( storage, uploa, n, a.data(), lda ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_symm( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector y_ref(y); diff --git a/gtestsuite/testsuite/level2/syr/test_syr.h b/gtestsuite/testsuite/level2/syr/test_syr.h index 3227cc2a4..3a62dd371 100644 --- a/gtestsuite/testsuite/level2/syr/test_syr.h +++ b/gtestsuite/testsuite/level2/syr/test_syr.h @@ -37,7 +37,6 @@ #include "syr.h" #include "level2/ref_syr.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -54,7 +53,7 @@ void test_syr( char storage, char uploa, char conjx, gtint_t n, T alpha, std::vector a = testinghelpers::get_random_matrix( -2, 5, storage, 'n', n, n, lda ); std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector a_ref(a); diff --git a/gtestsuite/testsuite/level2/syr2/test_syr2.h b/gtestsuite/testsuite/level2/syr2/test_syr2.h index 9389b6717..5f4e81f7b 100644 --- a/gtestsuite/testsuite/level2/syr2/test_syr2.h +++ b/gtestsuite/testsuite/level2/syr2/test_syr2.h @@ -37,7 +37,6 @@ #include "syr2.h" #include "level2/ref_syr2.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -55,8 +54,8 @@ void test_syr2( char storage, char uploa, char conjx, char conjy, gtint_t n, std::vector x = testinghelpers::get_random_vector( -3, 3, n, incx ); std::vector y = testinghelpers::get_random_vector( -3, 3, n, incy ); - mksymm( storage, uploa, n, a.data(), lda ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_symm( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector a_ref(a); diff --git a/gtestsuite/testsuite/level2/trmv/test_trmv.h b/gtestsuite/testsuite/level2/trmv/test_trmv.h index 80cf4d4f5..2ac5c7014 100644 --- a/gtestsuite/testsuite/level2/trmv/test_trmv.h +++ b/gtestsuite/testsuite/level2/trmv/test_trmv.h @@ -37,7 +37,6 @@ #include "trmv.h" #include "level2/ref_trmv.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -54,7 +53,7 @@ void test_trmv( char storage, char uploa, char transa, char diaga, gtint_t n, std::vector a = testinghelpers::get_random_matrix( -2, 8, storage, transa, n, n, lda ); std::vector x = testinghelpers::get_random_vector( -10, 10, n, incx ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector x_ref(x); diff --git a/gtestsuite/testsuite/level2/trsv/test_trsv.h b/gtestsuite/testsuite/level2/trsv/test_trsv.h index 096cd5ee0..c5f8cd61c 100644 --- a/gtestsuite/testsuite/level2/trsv/test_trsv.h +++ b/gtestsuite/testsuite/level2/trsv/test_trsv.h @@ -37,7 +37,6 @@ #include "trsv.h" #include "level2/ref_trsv.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -54,7 +53,7 @@ void test_trsv( char storage, char uploa, char transa, char diaga, gtint_t n, std::vector a = testinghelpers::get_random_matrix( 1, 5, storage, transa, n, n, lda ); std::vector x = testinghelpers::get_random_vector( 1, 3, n, incx ); - mktrim( storage, uploa, n, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, n, a.data(), lda ); // Create a copy of c so that we can check reference results. std::vector x_ref(x); diff --git a/gtestsuite/testsuite/level3/trmm/test_trmm.h b/gtestsuite/testsuite/level3/trmm/test_trmm.h index 96998bd6c..11e74f286 100644 --- a/gtestsuite/testsuite/level3/trmm/test_trmm.h +++ b/gtestsuite/testsuite/level3/trmm/test_trmm.h @@ -37,7 +37,6 @@ #include "trmm.h" #include "level3/ref_trmm.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -59,7 +58,7 @@ void test_trmm( char storage, char side, char uploa, char transa, char diaga, // Create a copy of v so that we can check reference results. std::vector b_ref(b); - mktrim( storage, uploa, mn, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, mn, a.data(), lda ); //---------------------------------------------------------- // Call BLIS function //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/trmm3/test_trmm3.h b/gtestsuite/testsuite/level3/trmm3/test_trmm3.h index 208d64a1e..84d6d1c0b 100644 --- a/gtestsuite/testsuite/level3/trmm3/test_trmm3.h +++ b/gtestsuite/testsuite/level3/trmm3/test_trmm3.h @@ -37,7 +37,6 @@ #include "trmm3.h" #include "level3/ref_trmm3.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -62,7 +61,7 @@ void test_trmm3( char storage, char side, char uploa, char transa, char diaga, // Create a copy of v so that we can check reference results. std::vector c_ref(c); - mktrim( storage, uploa, mn, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, mn, a.data(), lda ); //---------------------------------------------------------- // Call BLIS function //---------------------------------------------------------- diff --git a/gtestsuite/testsuite/level3/trsm/test_trsm.h b/gtestsuite/testsuite/level3/trsm/test_trsm.h index dc1e2a6cf..698a38282 100644 --- a/gtestsuite/testsuite/level3/trsm/test_trsm.h +++ b/gtestsuite/testsuite/level3/trsm/test_trsm.h @@ -37,7 +37,6 @@ #include "trsm.h" #include "level3/ref_trsm.h" #include "inc/check_error.h" -#include "inc/utils.h" #include #include @@ -67,7 +66,7 @@ void test_trsm( char storage, char side, char uploa, char transa, char diaga, // Create a copy of v so that we can check reference results. std::vector b_ref(b); - mktrim( storage, uploa, mn, a.data(), lda ); + testinghelpers::make_triangular( storage, uploa, mn, a.data(), lda ); //---------------------------------------------------------- // Call BLIS function //----------------------------------------------------------