Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 82962caf authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Merge branch 'blas3_std_version' into 'master'

Add standard version to the blas3 testings

See merge request !275
parents 5597bf0f ca034c6a
No related branches found
No related tags found
1 merge request!275Add standard version to the blas3 testings
......@@ -2,7 +2,7 @@
*
* @file testing_zgemm.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> c d s
*
*/
......@@ -130,6 +131,88 @@ testing_zgemm_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zgemm_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t transA = run_arg_get_trans( args, "transA", ChamNoTrans );
cham_trans_t transB = run_arg_get_trans( args, "transB", ChamNoTrans );
int N = run_arg_get_int( args, "N", 1000 );
int M = run_arg_get_int( args, "M", N );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", ( ( transA == ChamNoTrans ) ? M : K ) );
int LDB = run_arg_get_int( args, "LDB", ( ( transB == ChamNoTrans ) ? K : N ) );
int LDC = run_arg_get_int( args, "LDC", M );
CHAMELEON_Complex64_t alpha = testing_zalea();
CHAMELEON_Complex64_t beta = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
/* Descriptors */
int Am, An, Bm, Bn;
CHAMELEON_Complex64_t *A, *B, *C, *Cinit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_complex64( args, "beta", beta );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculate the dimensions according to the transposition */
if ( transA == ChamNoTrans ) {
Am = M;
An = K;
}
else {
Am = K;
An = M;
}
if ( transB == ChamNoTrans ) {
Bm = K;
Bn = N;
}
else {
Bm = N;
Bn = K;
}
/* Create the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*Bn*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fill the matrices with random values */
CHAMELEON_zplrnt( Am, An, A, LDA, seedA );
CHAMELEON_zplrnt( Bm, Bn, B, LDB, seedB );
CHAMELEON_zplrnt( M, N, C, LDC, seedC );
/* Calculate the product */
testing_start( &test_data );
hres = CHAMELEON_zgemm( transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zgemm( M, N, K ) );
/* Check the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( M, N, Cinit, LDC, seedC );
// hres += check_zgemm( args, transA, transB, alpha, descA, descB, beta, descCinit, descC );
free( Cinit );
}
free( A );
free( B );
free( C );
return hres;
}
testing_t test_zgemm;
const char *zgemm_params[] = { "mtxfmt", "nb", "transA", "transB", "m", "n",
"k", "lda", "ldb", "ldc", "alpha", "beta",
......@@ -150,7 +233,7 @@ testing_zgemm_init( void )
test_zgemm.output = zgemm_output;
test_zgemm.outchk = zgemm_outchk;
test_zgemm.fptr_desc = testing_zgemm_desc;
test_zgemm.fptr_std = NULL;
test_zgemm.fptr_std = testing_zgemm_std;
test_zgemm.next = NULL;
testing_register( &test_zgemm );
......
......@@ -2,7 +2,7 @@
*
* @file testing_zhemm.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> c
*
*/
......@@ -113,6 +114,80 @@ testing_zhemm_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zhemm_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_side_t side = run_arg_get_side( args, "side", ChamLeft );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int M = run_arg_get_int( args, "M", N );
int LDA = run_arg_get_int( args, "LDA", ( ( side == ChamLeft ) ? M : N ) );
int LDB = run_arg_get_int( args, "LDB", M );
int LDC = run_arg_get_int( args, "LDC", M );
CHAMELEON_Complex64_t alpha = testing_zalea();
CHAMELEON_Complex64_t beta = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
double bump = testing_dalea();
/* Descriptors */
int Am;
CHAMELEON_Complex64_t *A, *B, *C, *Cinit;
bump = run_arg_get_double( args, "bump", bump );
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_complex64( args, "beta", beta );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculate the dimensions according to the side */
if ( side == ChamLeft ) {
Am = M;
}
else {
Am = N;
}
/* Create the matrices */
A = malloc( LDA*Am*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplghe( bump, uplo, N, A, LDA, seedA );
CHAMELEON_zplrnt( M, N, B, LDB, seedB );
CHAMELEON_zplrnt( M, N, C, LDC, seedC );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_zhemm( side, uplo, M, N, alpha, A, LDA, B, LDB, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zhemm( side, M, N ) );
/* Checks the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( M, N, Cinit, LDC, seedC );
// hres += check_zsymm( args, ChamHermitian, side, uplo, alpha, descA, descB,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( B );
free( C );
return hres;
}
testing_t test_zhemm;
const char *zhemm_params[] = { "mtxfmt", "nb", "side", "uplo", "m", "n", "lda", "ldb",
"ldc", "alpha", "beta", "seedA", "seedB", "seedC", "bump", NULL };
......@@ -132,7 +207,7 @@ testing_zhemm_init( void )
test_zhemm.output = zhemm_output;
test_zhemm.outchk = zhemm_outchk;
test_zhemm.fptr_desc = testing_zhemm_desc;
test_zhemm.fptr_std = NULL;
test_zhemm.fptr_std = testing_zhemm_std;
test_zhemm.next = NULL;
testing_register( &test_zhemm );
......
......@@ -2,7 +2,7 @@
*
* @file testing_zher2k.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> z c
*
*/
......@@ -102,8 +103,8 @@ testing_zher2k_desc( run_arg_list_t *args, int check )
&descCinit, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDC, N, 0, 0, N, N, P, Q );
CHAMELEON_zplghe_Tile( bump, uplo, descCinit, seedC );
hres +=
check_zsyrk( args, ChamHermitian, uplo, trans, alpha, descA, descB, beta, descCinit, descC );
hres += check_zsyrk( args, ChamHermitian, uplo, trans, alpha, descA, descB,
beta, descCinit, descC );
CHAMELEON_Desc_Destroy( &descCinit );
}
......@@ -115,6 +116,82 @@ testing_zher2k_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zher2k_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDB = run_arg_get_int( args, "LDB", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDC = run_arg_get_int( args, "LDC", N );
CHAMELEON_Complex64_t alpha = testing_zalea();
double beta = testing_dalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
double bump = testing_dalea();
/* Descriptors */
int Am, An;
CHAMELEON_Complex64_t *A, *B, *C, *Cinit;
bump = run_arg_get_double( args, "bump", bump );
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_double( args, "beta", beta );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculate the dimensions according to the transposition */
if ( trans == ChamNoTrans ) {
Am = N;
An = K;
}
else {
Am = K;
An = N;
}
/* Create the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fill the matrix with random values */
CHAMELEON_zplrnt( Am, An, B, LDA, seedA );
CHAMELEON_zplrnt( K, An, B, LDB, seedB );
CHAMELEON_zplghe( bump, uplo, N, C, LDC, seedC );
/* Calculate the product */
testing_start( &test_data );
hres = CHAMELEON_zher2k( uplo, trans, N, K, alpha, A, LDA, B, LDB, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zher2k( K, N ) );
/* Check the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplghe( bump, uplo, N, Cinit, LDC, seedC );
// hres += check_zsyrk( args, ChamHermitian, uplo, trans, alpha, descA, descB,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( B );
free( C );
return hres;
}
testing_t test_zher2k;
const char *zher2k_params[] = { "mtxfmt", "nb", "trans", "uplo", "n", "k",
"lda", "ldb", "ldc", "alpha", "beta", "seedA",
......@@ -135,7 +212,7 @@ testing_zher2k_init( void )
test_zher2k.output = zher2k_output;
test_zher2k.outchk = zher2k_outchk;
test_zher2k.fptr_desc = testing_zher2k_desc;
test_zher2k.fptr_std = NULL;
test_zher2k.fptr_std = testing_zher2k_std;
test_zher2k.next = NULL;
testing_register( &test_zher2k );
......
......@@ -2,7 +2,7 @@
*
* @file testing_zherk.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,12 +13,12 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> z c
*
*/
#include <chameleon.h>
#include <chameleon/flops.h>
#include "testings.h"
#include "testing_zcheck.h"
#include <chameleon/flops.h>
......@@ -109,6 +109,78 @@ testing_zherk_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zherk_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDC = run_arg_get_int( args, "LDC", N );
double alpha = testing_dalea();
double beta = testing_dalea();
double bump = testing_dalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
/* Descriptors */
int Am, An;
CHAMELEON_Complex64_t *A, *C, *Cinit;
alpha = run_arg_get_double( args, "alpha", alpha );
beta = run_arg_get_double( args, "beta", beta );
bump = run_arg_get_double( args, "bump", bump );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculates the dimensions according to the transposition */
if ( trans == ChamNoTrans ) {
Am = N;
An = K;
}
else {
Am = K;
An = N;
}
/* Creates the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplrnt( Am, An, A, LDA, seedA );
CHAMELEON_zplghe( bump, uplo, N, C, LDC, seedC );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_zherk( uplo, trans, N, K, alpha, A, LDA, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zherk( K, N ) );
/* Checks the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplghe( bump, uplo, N, Cinit, LDC, seedC );
// hres += check_zsyrk( args, ChamHermitian, uplo, trans, alpha, descA, NULL,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( C );
return hres;
}
testing_t test_zherk;
const char *zherk_params[] = { "mtxfmt", "nb", "trans", "uplo", "n", "k", "lda",
"ldc", "alpha", "beta", "seedA", "seedC", "bump", NULL };
......
......@@ -2,7 +2,7 @@
*
* @file testing_zsymm.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> c d s
*
*/
......@@ -113,6 +114,80 @@ testing_zsymm_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zsymm_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_side_t side = run_arg_get_side( args, "side", ChamLeft );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int M = run_arg_get_int( args, "M", N );
int LDA = run_arg_get_int( args, "LDA", ( ( side == ChamLeft ) ? M : N ) );
int LDB = run_arg_get_int( args, "LDB", M );
int LDC = run_arg_get_int( args, "LDC", M );
CHAMELEON_Complex64_t alpha = testing_zalea();
CHAMELEON_Complex64_t beta = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
double bump = testing_dalea();
/* Descriptors */
int Am;
CHAMELEON_Complex64_t *A, *B, *C, *Cinit;
bump = run_arg_get_double( args, "bump", bump );
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_complex64( args, "beta", beta );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculate the dimensions according to the side */
if ( side == ChamLeft ) {
Am = M;
}
else {
Am = N;
}
/* Create the matrices */
A = malloc( LDA*Am*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplgsy( bump, uplo, N, A, LDA, seedA );
CHAMELEON_zplrnt( M, N, B, LDB, seedB );
CHAMELEON_zplrnt( M, N, C, LDC, seedC );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_zsymm( side, uplo, Am, N, alpha, A, LDA, B, LDB, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zsymm( side, M, N ) );
/* Checks the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( M, N, Cinit, LDC, seedC );
// hres += check_zsymm( args, ChamSymmetric, side, uplo, alpha, descA, descB,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( B );
free( C );
return hres;
}
testing_t test_zsymm;
const char *zsymm_params[] = { "mtxfmt", "nb", "side", "uplo", "m", "n", "lda", "ldb",
"ldc", "alpha", "beta", "seedA", "seedB", "seedC", "bump", NULL };
......@@ -132,7 +207,7 @@ testing_zsymm_init( void )
test_zsymm.output = zsymm_output;
test_zsymm.outchk = zsymm_outchk;
test_zsymm.fptr_desc = testing_zsymm_desc;
test_zsymm.fptr_std = NULL;
test_zsymm.fptr_std = testing_zsymm_std;
test_zsymm.next = NULL;
testing_register( &test_zsymm );
......
......@@ -2,7 +2,7 @@
*
* @file testing_zsyr2k.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> z c d s
*
*/
......@@ -115,6 +116,82 @@ testing_zsyr2k_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zsyr2k_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDB = run_arg_get_int( args, "LDB", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDC = run_arg_get_int( args, "LDC", N );
CHAMELEON_Complex64_t alpha = testing_zalea();
CHAMELEON_Complex64_t beta = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
double bump = testing_dalea();
/* Descriptors */
int Am, An;
CHAMELEON_Complex64_t *A, *B, *C, *Cinit;
bump = run_arg_get_double( args, "bump", bump );
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_complex64( args, "beta", beta );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculate the dimensions according to the transposition */
if ( trans == ChamNoTrans ) {
Am = N;
An = K;
}
else {
Am = K;
An = N;
}
/* Create the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fill the matrix with random values */
CHAMELEON_zplrnt( Am, An, A, LDA, seedA );
CHAMELEON_zplrnt( Am, An, B, LDB, seedB );
CHAMELEON_zplgsy( bump, uplo, N, C, LDC, seedC );
/* Calculate the product */
testing_start( &test_data );
hres = CHAMELEON_zsyr2k( uplo, trans, N, K, alpha, A, LDA, B, LDB, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zher2k( K, N ) );
/* Check the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplgsy( bump, uplo, N, Cinit, LDC, seedC );
// hres += check_zsyrk( args, ChamSymmetric, uplo, trans, alpha, descA, descB,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( B );
free( C );
return hres;
}
testing_t test_zsyr2k;
const char *zsyr2k_params[] = { "mtxfmt", "nb", "trans", "uplo", "n", "k",
"lda", "ldb", "ldc", "alpha", "beta", "seedA",
......@@ -135,7 +212,7 @@ testing_zsyr2k_init( void )
test_zsyr2k.output = zsyr2k_output;
test_zsyr2k.outchk = zsyr2k_outchk;
test_zsyr2k.fptr_desc = testing_zsyr2k_desc;
test_zsyr2k.fptr_std = NULL;
test_zsyr2k.fptr_std = testing_zsyr2k_std;
test_zsyr2k.next = NULL;
testing_register( &test_zsyr2k );
......
......@@ -2,7 +2,7 @@
*
* @file testing_zsyrk.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> z c d s
*
*/
......@@ -108,6 +109,77 @@ testing_zsyrk_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_zsyrk_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
int N = run_arg_get_int( args, "N", 1000 );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", ( ( trans == ChamNoTrans ) ? N : K ) );
int LDC = run_arg_get_int( args, "LDC", N );
CHAMELEON_Complex64_t alpha = testing_zalea();
CHAMELEON_Complex64_t beta = testing_zalea();
CHAMELEON_Complex64_t bump = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedC = run_arg_get_int( args, "seedC", random() );
/* Descriptors */
int Am, An;
CHAMELEON_Complex64_t *A, *C, *Cinit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
beta = run_arg_get_complex64( args, "beta", beta );
bump = run_arg_get_complex64( args, "bump", bump );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculates the dimensions according to the transposition */
if ( trans == ChamNoTrans ) {
Am = N;
An = K;
}
else {
Am = K;
An = N;
}
/* Creates the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplrnt( Am, An, A, LDA, seedA );
CHAMELEON_zplgsy( bump, uplo, N, C, LDC, seedC );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_zsyrk( uplo, trans, N, K, alpha, A, LDA, beta, C, LDC );
test_data.hres = hres;
testing_stop( &test_data, flops_zsyrk( K, N ) );
/* Checks the solution */
if ( check ) {
Cinit = malloc( LDC*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplgsy( bump, uplo, N, Cinit, LDC, seedC );
// hres += check_zsyrk( args, ChamSymmetric, uplo, trans, alpha, descA, NULL,
// beta, descCinit, descC );
free( Cinit );
}
free( A );
free( C );
return hres;
}
testing_t test_zsyrk;
const char *zsyrk_params[] = { "mtxfmt", "nb", "trans", "uplo", "n", "k", "lda",
"ldc", "alpha", "beta", "seedA", "seedC", "bump", NULL };
......@@ -127,7 +199,7 @@ testing_zsyrk_init( void )
test_zsyrk.output = zsyrk_output;
test_zsyrk.outchk = zsyrk_outchk;
test_zsyrk.fptr_desc = testing_zsyrk_desc;
test_zsyrk.fptr_std = NULL;
test_zsyrk.fptr_std = testing_zsyrk_std;
test_zsyrk.next = NULL;
testing_register( &test_zsyrk );
......
......@@ -2,7 +2,7 @@
*
* @file testing_ztrmm.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> c d s
*
*/
......@@ -106,6 +107,75 @@ testing_ztrmm_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_ztrmm_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_side_t side = run_arg_get_side( args, "side", ChamLeft );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
cham_diag_t diag = run_arg_get_diag( args, "diag", ChamNonUnit );
int N = run_arg_get_int( args, "N", 1000 );
int K = run_arg_get_int( args, "K", N );
int LDA = run_arg_get_int( args, "LDA", N );
int LDB = run_arg_get_int( args, "LDB", N );
CHAMELEON_Complex64_t alpha = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
/* Descriptors */
int Bm, Bn;
CHAMELEON_Complex64_t *A, *B, *Binit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Calculates the dimensions according to the side */
if ( side == ChamLeft ) {
Bm = N;
Bn = K;
}
else {
Bm = K;
Bn = N;
}
/* Creates the matrices */
A = malloc( LDA*N*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*Bn*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplrnt( K, N, A, LDA, seedA );
CHAMELEON_zplrnt( Bm, Bn, B, LDB, seedB );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_ztrmm( side, uplo, trans, diag, N, K, alpha, A, LDA, B, LDB );
test_data.hres = hres;
testing_stop( &test_data, flops_ztrmm( side, N, K ) );
/* Checks the solution */
if ( check ) {
Binit = malloc( LDB*Bn*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( Bm, Bn, Binit, LDB, seedB );
// hres += check_ztrmm( args, CHECK_TRMM, side, uplo, trans, diag,
// alpha, descA, descB, descBinit );
free( Binit );
}
free( A );
free( B );
return hres;
}
testing_t test_ztrmm;
const char *ztrmm_params[] = { "mtxfmt", "nb", "trans", "side", "uplo", "diag", "n",
"k", "lda", "ldb", "alpha", "seedA", "seedB", NULL };
......@@ -125,7 +195,7 @@ testing_ztrmm_init( void )
test_ztrmm.output = ztrmm_output;
test_ztrmm.outchk = ztrmm_outchk;
test_ztrmm.fptr_desc = testing_ztrmm_desc;
test_ztrmm.fptr_std = NULL;
test_ztrmm.fptr_std = testing_ztrmm_std;
test_ztrmm.next = NULL;
testing_register( &test_ztrmm );
......
......@@ -2,7 +2,7 @@
*
* @file testing_ztrsm.c
*
* @copyright 2019-2021 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2019-2022 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
***
......@@ -13,7 +13,8 @@
* @author Lucas Barros de Assis
* @author Florent Pruvost
* @author Mathieu Faverge
* @date 2020-11-19
* @author Alycia Lisito
* @date 2022-02-04
* @precisions normal z -> c d s
*
*/
......@@ -97,6 +98,66 @@ testing_ztrsm_desc( run_arg_list_t *args, int check )
return hres;
}
int
testing_ztrsm_std( run_arg_list_t *args, int check )
{
testdata_t test_data = { .args = args };
int hres = 0;
/* Read arguments */
int nb = run_arg_get_int( args, "nb", 320 );
cham_trans_t trans = run_arg_get_trans( args, "trans", ChamNoTrans );
cham_side_t side = run_arg_get_side( args, "side", ChamLeft );
cham_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper );
cham_diag_t diag = run_arg_get_diag( args, "diag", ChamNonUnit );
int N = run_arg_get_int( args, "N", 1000 );
int M = run_arg_get_int( args, "M", N );
int Ak = ( side == ChamLeft ) ? M : N;
int LDA = run_arg_get_int( args, "LDA", Ak );
int LDB = run_arg_get_int( args, "LDB", M );
CHAMELEON_Complex64_t alpha = testing_zalea();
int seedA = run_arg_get_int( args, "seedA", random() );
int seedB = run_arg_get_int( args, "seedB", random() );
/* Descriptors */
CHAMELEON_Complex64_t *A, *B, *Binit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb );
/* Creates the matrices */
A = malloc( LDA*Ak*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
/* We bump a little bit the diagonal to make it stable */
CHAMELEON_zplgsy( 2., uplo, N, A, LDA, seedA );
CHAMELEON_zplrnt( M, N, B, LDB, seedB );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_ztrsm( side, uplo, trans, diag, N, M, alpha, A, LDA, B, LDB );
test_data.hres = hres;
testing_stop( &test_data, flops_ztrsm( side, M, N ) );
/* Checks the solution */
if ( check ) {
Binit = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( M, N, Binit, LDB, seedB );
// hres += check_ztrmm( args, CHECK_TRSM, side, uplo, trans, diag,
// alpha, descA, descB, descBinit );
free( Binit );
}
free( A );
free( B );
return hres;
}
testing_t test_ztrsm;
const char *ztrsm_params[] = { "mtxfmt", "nb", "side", "uplo", "trans", "diag", "m",
"n", "lda", "ldb", "alpha", "seedA", "seedB", NULL };
......@@ -116,7 +177,7 @@ testing_ztrsm_init( void )
test_ztrsm.output = ztrsm_output;
test_ztrsm.outchk = ztrsm_outchk;
test_ztrsm.fptr_desc = testing_ztrsm_desc;
test_ztrsm.fptr_std = NULL;
test_ztrsm.fptr_std = testing_ztrsm_std;
test_ztrsm.next = NULL;
testing_register( &test_ztrsm );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment