Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2b593c5d authored by LISITO Alycia's avatar LISITO Alycia Committed by Mathieu Faverge
Browse files

testing: add check for the std api in the blas3 testings

parent 7bab5171
No related branches found
No related tags found
1 merge request!281Add standard api check for blas3
......@@ -156,8 +156,8 @@ testing_zhemm_std( run_arg_list_t *args, int check )
/* 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) );
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 );
......@@ -175,8 +175,7 @@ testing_zhemm_std( run_arg_list_t *args, int 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 );
hres += check_zsymm_std( args, ChamHermitian, side, uplo, M, N, alpha, A, LDA, B, LDB, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -161,11 +161,11 @@ testing_zher2k_std( run_arg_list_t *args, int check )
/* 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) );
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_zplrnt( K, An, B, LDB, seedB );
CHAMELEON_zplghe( bump, uplo, N, C, LDC, seedC );
/* Calculate the product */
......@@ -179,8 +179,7 @@ testing_zher2k_std( run_arg_list_t *args, int 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 );
hres += check_zsyrk_std( args, ChamHermitian, uplo, trans, N, K, alpha, A, B, LDA, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -152,7 +152,7 @@ testing_zherk_std( run_arg_list_t *args, int check )
/* Creates the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*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 );
......@@ -169,8 +169,7 @@ testing_zherk_std( run_arg_list_t *args, int 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 );
hres += check_zsyrk_std( args, ChamHermitian, uplo, trans, N, K, alpha, A, NULL, LDA, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -175,8 +175,7 @@ testing_zsymm_std( run_arg_list_t *args, int 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 );
hres += check_zsymm_std( args, ChamSymmetric, side, uplo, M, N, alpha, A, LDA, B, LDB, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -161,7 +161,7 @@ testing_zsyr2k_std( run_arg_list_t *args, int check )
/* 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) );
C = malloc( LDC*N *sizeof(CHAMELEON_Complex64_t) );
/* Fill the matrix with random values */
CHAMELEON_zplrnt( Am, An, A, LDA, seedA );
......@@ -179,8 +179,7 @@ testing_zsyr2k_std( run_arg_list_t *args, int 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 );
hres += check_zsyrk_std( args, ChamSymmetric, uplo, trans, N, K, alpha, A, B, LDA, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -151,7 +151,7 @@ testing_zsyrk_std( run_arg_list_t *args, int check )
/* Creates the matrices */
A = malloc( LDA*An*sizeof(CHAMELEON_Complex64_t) );
C = malloc( LDC*N*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 );
......@@ -168,8 +168,7 @@ testing_zsyrk_std( run_arg_list_t *args, int 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 );
hres += check_zsyrk_std( args, ChamSymmetric, uplo, trans, N, K, alpha, A, NULL, LDA, beta, Cinit, C, LDC );
free( Cinit );
}
......
......@@ -39,16 +39,15 @@ testing_ztrmm_desc( run_arg_list_t *args, int check )
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 M = run_arg_get_int( args, "M", N );
int LDA = run_arg_get_int( args, "LDA", N );
int LDB = run_arg_get_int( args, "LDB", N );
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() );
int Q = parameters_compute_q( P );
/* Descriptors */
int Bm, Bn;
CHAM_desc_t *descA, *descB, *descBinit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
......@@ -57,19 +56,19 @@ testing_ztrmm_desc( run_arg_list_t *args, int check )
/* Calculates the dimensions according to the side */
if ( side == ChamLeft ) {
Bm = N;
Bn = K;
LDA = M;
CHAMELEON_Desc_Create(
&descA, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDA, M, 0, 0, M, M, P, Q );
}
else {
Bm = K;
Bn = N;
LDA = N;
CHAMELEON_Desc_Create(
&descA, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDA, N, 0, 0, N, N, P, Q );
}
/* Creates the matrices */
CHAMELEON_Desc_Create(
&descA, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDA, N, 0, 0, N, N, P, Q );
CHAMELEON_Desc_Create(
&descB, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDB, Bn, 0, 0, Bm, Bn, P, Q );
&descB, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDB, N, 0, 0, M, N, P, Q );
/* Fills the matrix with random values */
CHAMELEON_zplrnt_Tile( descA, seedA );
......@@ -87,12 +86,12 @@ testing_ztrmm_desc( run_arg_list_t *args, int check )
hres = CHAMELEON_ztrmm_Tile( side, uplo, trans, diag, alpha, descA, descB );
}
test_data.hres = hres;
testing_stop( &test_data, flops_ztrmm( side, N, K ) );
testing_stop( &test_data, flops_ztrmm( side, N, M ) );
/* Checks the solution */
if ( check ) {
CHAMELEON_Desc_Create(
&descBinit, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDB, Bn, 0, 0, Bm, Bn, P, Q );
&descBinit, (void*)(-mtxfmt), ChamComplexDouble, nb, nb, nb * nb, LDB, N, 0, 0, M, N, P, Q );
CHAMELEON_zplrnt_Tile( descBinit, seedB );
hres += check_ztrmm( args, CHECK_TRMM, side, uplo, trans, diag,
......@@ -120,15 +119,15 @@ testing_ztrmm_std( run_arg_list_t *args, int check )
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 M = run_arg_get_int( args, "M", N );
int LDA = run_arg_get_int( args, "LDA", N );
int LDB = run_arg_get_int( args, "LDB", N );
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 */
int Bm, Bn;
int An;
CHAMELEON_Complex64_t *A, *B, *Binit;
alpha = run_arg_get_complex64( args, "alpha", alpha );
......@@ -137,35 +136,35 @@ testing_ztrmm_std( run_arg_list_t *args, int check )
/* Calculates the dimensions according to the side */
if ( side == ChamLeft ) {
Bm = N;
Bn = K;
An = M;
LDA = M;
A = malloc( LDA*N *sizeof(CHAMELEON_Complex64_t) );
}
else {
Bm = K;
Bn = N;
An = N;
LDA = N;
A = malloc( LDA*N *sizeof(CHAMELEON_Complex64_t) );
}
/* Creates the matrices */
A = malloc( LDA*N*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*Bn*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
/* Fills the matrix with random values */
CHAMELEON_zplrnt( K, N, A, LDA, seedA );
CHAMELEON_zplrnt( Bm, Bn, B, LDB, seedB );
CHAMELEON_zplrnt( An, An, A, LDA, seedA );
CHAMELEON_zplrnt( M, N, B, LDB, seedB );
/* Calculates the product */
testing_start( &test_data );
hres = CHAMELEON_ztrmm( side, uplo, trans, diag, N, K, alpha, A, LDA, B, LDB );
hres = CHAMELEON_ztrmm( side, uplo, trans, diag, N, M, alpha, A, LDA, B, LDB );
test_data.hres = hres;
testing_stop( &test_data, flops_ztrmm( side, N, K ) );
testing_stop( &test_data, flops_ztrmm( side, N, M ) );
/* Checks the solution */
if ( check ) {
Binit = malloc( LDB*Bn*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( Bm, Bn, Binit, LDB, seedB );
Binit = malloc( LDB*N*sizeof(CHAMELEON_Complex64_t) );
CHAMELEON_zplrnt( M, N, Binit, LDB, seedB );
// hres += check_ztrmm( args, CHECK_TRMM, side, uplo, trans, diag,
// alpha, descA, descB, descBinit );
hres += check_ztrmm_std( args, CHECK_TRMM, side, uplo, trans, diag, N, M, alpha, A, LDA, B, Binit, LDB );
free( Binit );
}
......@@ -177,8 +176,8 @@ testing_ztrmm_std( run_arg_list_t *args, int check )
}
testing_t test_ztrmm;
const char *ztrmm_params[] = { "mtxfmt", "nb", "trans", "side", "uplo", "diag", "n",
"k", "lda", "ldb", "alpha", "seedA", "seedB", NULL };
const char *ztrmm_params[] = { "mtxfmt", "nb", "trans", "side", "uplo", "diag", "m",
"n", "lda", "ldb", "alpha", "seedA", "seedB", NULL };
const char *ztrmm_output[] = { NULL };
const char *ztrmm_outchk[] = { "RETURN", NULL };
......
......@@ -128,7 +128,7 @@ testing_ztrsm_std( run_arg_list_t *args, int check )
/* Creates the matrices */
A = malloc( LDA*Ak*sizeof(CHAMELEON_Complex64_t) );
B = malloc( LDB*N*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 */
......@@ -146,8 +146,7 @@ testing_ztrsm_std( run_arg_list_t *args, int 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 );
hres += check_ztrmm_std( args, CHECK_TRSM, side, uplo, trans, diag, M, N, alpha, A, LDA, B, Binit, LDB );
free( Binit );
}
......
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