time_zgetrf_nopiv.c 1.95 KB
Newer Older
1
/**
2 3
 *
 * @file time_zgetrf_nopiv.c
4
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
5 6
 * @copyright 2009-2014 The University of Tennessee and The University of
 *                      Tennessee Research Foundation. All rights reserved.
Mathieu Faverge's avatar
Mathieu Faverge committed
7
 * @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8
 *                      Univ. Bordeaux. All rights reserved.
9
 *
10
 ***
11
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
12
 * @version 1.0.0
13 14
 * @precisions normal z -> c d s
 *
15
 */
16
#define _TYPE  CHAMELEON_Complex64_t
17 18 19
#define _PREC  double
#define _LAMCH LAPACKE_dlamch_work

20
#define _NAME  "CHAMELEON_zgetrf_Tile"
21 22 23 24 25
/* See Lawn 41 page 120 */
#define _FMULS FMULS_GETRF(M, N)
#define _FADDS FADDS_GETRF(M, N)

#include "./timing.c"
26
#include "timing_zauxiliary.h"
27 28

static int
Mathieu Faverge's avatar
Mathieu Faverge committed
29
RunTest(int *iparam, double *dparam, chameleon_time_t *t_) 
30 31 32 33 34 35 36 37 38
{
    PASTE_CODE_IPARAM_LOCALS( iparam );

    if ( M != N && check ) {
        fprintf(stderr, "Check cannot be perfomed with M != N\n");
        check = 0;
    }

    /* Allocate Data */
39
    PASTE_CODE_ALLOCATE_MATRIX( A, 1, CHAMELEON_Complex64_t, LDA, N );
40 41
    
    /* Initialize Data */
42
    CHAMELEON_zplrnt(M, N, A, LDA, 3456);
43 44

    /* Save AT in lapack layout for check */
45
    PASTE_CODE_ALLOCATE_COPY( Acpy, check, CHAMELEON_Complex64_t, A, LDA, N );
46 47
    
    START_TIMING();
48
    CHAMELEON_zgetrf_nopiv( M, N, A, LDA );
49 50 51 52 53
    STOP_TIMING();
    
    /* Check the solution */
    if ( check )
    {
54 55 56
        PASTE_CODE_ALLOCATE_MATRIX( X, 1, CHAMELEON_Complex64_t, LDB, NRHS );
        CHAMELEON_zplrnt( N, NRHS, X, LDB, 7732 );
        PASTE_CODE_ALLOCATE_COPY( B, 1, CHAMELEON_Complex64_t, X, LDB, NRHS );
57

58
        CHAMELEON_zgetrs_nopiv( ChamNoTrans, N, NRHS, A, LDA, X, LDB );
59 60 61 62 63 64 65 66 67 68 69 70

        dparam[IPARAM_RES] = z_check_solution(M, N, NRHS, Acpy, LDA, B, X, LDB,
                                              &(dparam[IPARAM_ANORM]), 
                                              &(dparam[IPARAM_BNORM]), 
                                              &(dparam[IPARAM_XNORM]));
        free(Acpy); free(B); free(X);
    }

    free(A);
 
    return 0;
}