diff --git a/testing/testing_zlange.c b/testing/testing_zlange.c index 7b5f2810d94697c6be6fe908e508eefe940576b8..e4a9195e0a3e625eee9a8ca70f222baf9f1facbd 100644 --- a/testing/testing_zlange.c +++ b/testing/testing_zlange.c @@ -2,7 +2,7 @@ * * @file testing_zlange.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-07 * @precisions normal z -> c d s * */ @@ -107,6 +108,48 @@ testing_zlange_desc( run_arg_list_t *args, int check ) return hres; } +int +testing_zlange_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_normtype_t norm_type = run_arg_get_ntype( args, "norm", ChamMaxNorm ); + 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", M ); + int seedA = run_arg_get_int( args, "seedA", random() ); + + /* Descriptors */ + CHAMELEON_Complex64_t *A; + + CHAMELEON_Set( CHAMELEON_TILE_SIZE, nb ); + + /* Creates the matrix */ + A = malloc( LDA*N*sizeof(CHAMELEON_Complex64_t) ); + + /* Fills the matrix with random values */ + CHAMELEON_zplrnt( M, N, A, LDA, seedA ); + + /* Calculates the norm */ + testing_start( &test_data ); + CHAMELEON_zlange( norm_type, M, N, A, LDA ); + test_data.hres = hres; + testing_stop( &test_data, flops_zlange( norm_type, M, N ) ); + + /* Checks the solution */ + if ( check ) { + // hres = check_znorm( args, ChamGeneral, norm_type, ChamUpperLower, + // ChamNonUnit, norm, descA ); + } + + free( A ); + + return hres; +} + testing_t test_zlange; const char *zlange_params[] = { "mtxfmt", "nb", "norm", "m", "n", "lda", "seedA", NULL }; const char *zlange_output[] = { NULL }; @@ -125,7 +168,7 @@ testing_zlange_init( void ) test_zlange.output = zlange_output; test_zlange.outchk = zlange_outchk; test_zlange.fptr_desc = testing_zlange_desc; - test_zlange.fptr_std = NULL; + test_zlange.fptr_std = testing_zlange_std; test_zlange.next = NULL; testing_register( &test_zlange );