From 2b593c5d386d710ba4d61ab5707af0f540bb79b0 Mon Sep 17 00:00:00 2001 From: Alycia Lisito <alycia.lisito@inria.fr> Date: Wed, 9 Feb 2022 15:38:15 +0100 Subject: [PATCH] testing: add check for the std api in the blas3 testings --- testing/testing_zhemm.c | 7 ++--- testing/testing_zher2k.c | 7 ++--- testing/testing_zherk.c | 5 ++-- testing/testing_zsymm.c | 3 +- testing/testing_zsyr2k.c | 5 ++-- testing/testing_zsyrk.c | 5 ++-- testing/testing_ztrmm.c | 61 ++++++++++++++++++++-------------------- testing/testing_ztrsm.c | 5 ++-- 8 files changed, 45 insertions(+), 53 deletions(-) diff --git a/testing/testing_zhemm.c b/testing/testing_zhemm.c index 9fc000642..b89b2bb3c 100644 --- a/testing/testing_zhemm.c +++ b/testing/testing_zhemm.c @@ -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 ); } diff --git a/testing/testing_zher2k.c b/testing/testing_zher2k.c index 1507b35e7..79509cd08 100644 --- a/testing/testing_zher2k.c +++ b/testing/testing_zher2k.c @@ -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 ); } diff --git a/testing/testing_zherk.c b/testing/testing_zherk.c index 3f6a02f32..83ade364b 100644 --- a/testing/testing_zherk.c +++ b/testing/testing_zherk.c @@ -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 ); } diff --git a/testing/testing_zsymm.c b/testing/testing_zsymm.c index a8d8bf0c0..f87066a87 100644 --- a/testing/testing_zsymm.c +++ b/testing/testing_zsymm.c @@ -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 ); } diff --git a/testing/testing_zsyr2k.c b/testing/testing_zsyr2k.c index 49f204790..1db847448 100644 --- a/testing/testing_zsyr2k.c +++ b/testing/testing_zsyr2k.c @@ -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 ); } diff --git a/testing/testing_zsyrk.c b/testing/testing_zsyrk.c index 164d8ff5f..87be0bd64 100644 --- a/testing/testing_zsyrk.c +++ b/testing/testing_zsyrk.c @@ -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 ); } diff --git a/testing/testing_ztrmm.c b/testing/testing_ztrmm.c index dced32a2e..9809931fc 100644 --- a/testing/testing_ztrmm.c +++ b/testing/testing_ztrmm.c @@ -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 }; diff --git a/testing/testing_ztrsm.c b/testing/testing_ztrsm.c index 851df92b8..89cd4f733 100644 --- a/testing/testing_ztrsm.c +++ b/testing/testing_ztrsm.c @@ -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 ); } -- GitLab