diff --git a/testing/testing_zpoinv.c b/testing/testing_zpoinv.c index 2b5ff90b76186cc4443bb3f34bddc54929e1d74c..db8d2f93967704c917d6ed5d370b771427937ba1 100644 --- a/testing/testing_zpoinv.c +++ b/testing/testing_zpoinv.c @@ -14,7 +14,7 @@ * @author Florent Pruvost * @author Mathieu Faverge * @author Alycia Lisito - * @date 2022-02-02 + * @date 2022-02-07 * @precisions normal z -> c d s * */ @@ -87,6 +87,51 @@ testing_zpoinv_desc( run_arg_list_t *args, int check ) return hres; } +int +testing_zpoinv_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_uplo_t uplo = run_arg_get_uplo( args, "uplo", ChamUpper ); + int N = run_arg_get_int( args, "N", 1000 ); + int LDA = run_arg_get_int( args, "LDA", N ); + int seedA = run_arg_get_int( args, "seedA", random() ); + + /* Descriptors */ + CHAMELEON_Complex64_t *A; + + CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb ); + + /* Create the matrices */ + A = malloc( LDA*N*sizeof(CHAMELEON_Complex64_t) ); + + /* Initialise the matrix with the random values */ + CHAMELEON_zplghe( (double)N, uplo, N, A, LDA, seedA ); + + /* Calculates the inversed matrix */ + testing_start( &test_data ); + hres = CHAMELEON_zpoinv( uplo, N, A, LDA ); + test_data.hres = hres; + testing_stop( &test_data, flops_zpoinv( N ) ); + + /* Check the inverse */ + if ( check ) { + CHAMELEON_Complex64_t *A0 = malloc( LDA * N * sizeof(CHAMELEON_Complex64_t) ); + CHAMELEON_zplghe( (double)N, uplo, N, A0, LDA, seedA ); + + // hres += check_ztrtri( args, ChamHermitian, uplo, ChamNonUnit, descA0, descA ); + + free( A0 ); + } + + free( A ); + + return hres; +} + testing_t test_zpoinv; const char *zpoinv_params[] = { "mtxfmt", "nb", "uplo", "n", "lda", "seedA", NULL }; const char *zpoinv_output[] = { NULL }; @@ -105,7 +150,7 @@ testing_zpoinv_init( void ) test_zpoinv.output = zpoinv_output; test_zpoinv.outchk = zpoinv_outchk; test_zpoinv.fptr_desc = testing_zpoinv_desc; - test_zpoinv.fptr_std = NULL; + test_zpoinv.fptr_std = testing_zpoinv_std; test_zpoinv.next = NULL; testing_register( &test_zpoinv );