time_zsytrf_tile.c 2.25 KB
Newer Older
1
/**
2 3
 *
 * @file time_zsytrf_tile.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.
7 8
 * @copyright 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
 *                      Univ. Bordeaux. All rights reserved.
9
 *
10
 ***
11
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
12
 * @version 1.0.0
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
 * @precisions normal z -> c
 *
 **/
#define _TYPE  MORSE_Complex64_t
#define _PREC  double
#define _LAMCH LAPACKE_dlamch_work

#define _NAME  "MORSE_zsytrf_Tile"
/* See Lawn 41 page 120 */
#define _FMULS FMULS_SYTRF( N )
#define _FADDS FADDS_SYTRF( N )

#include "./timing.c"

static int
RunTest(int *iparam, double *dparam, morse_time_t *t_)
{
    PASTE_CODE_IPARAM_LOCALS( iparam );
    int uplo = MorseUpper;

33
    LDA = chameleon_max(LDA, N);
34 35 36 37 38 39

    /* Allocate Data */
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descA,  1,     MORSE_Complex64_t, MorseComplexDouble, LDA, N, N    );
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descB,  check, MORSE_Complex64_t, MorseComplexDouble, LDB, N, NRHS );
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descAC, check, MORSE_Complex64_t, MorseComplexDouble, LDA, N, N    );
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descX,  check, MORSE_Complex64_t, MorseComplexDouble, LDB, N, NRHS );
40
    MORSE_zplgsy_Tile( (double)N, MorseUpperLower, descA, 51 );
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

    /* Save A for check */
    if (check == 1){
        MORSE_zlacpy_Tile(MorseUpperLower, descA, descAC);
    }

    /* MORSE ZSYSV */
    START_TIMING();
    MORSE_zsytrf_Tile(uplo, descA);
    STOP_TIMING();

    /* Check the solution */
    if ( check )
    {
        MORSE_zplrnt_Tile( descB, 7672 );
        MORSE_zlacpy_Tile(MorseUpperLower, descB, descX);
        MORSE_zsytrs_Tile( uplo, descA, descX );
        dparam[IPARAM_ANORM] = MORSE_zlange_Tile(MorseInfNorm, descAC);
        dparam[IPARAM_BNORM] = MORSE_zlange_Tile(MorseInfNorm, descB);
        dparam[IPARAM_XNORM] = MORSE_zlange_Tile(MorseInfNorm, descX);
61 62
                MORSE_zgemm_Tile( MorseNoTrans, MorseNoTrans, 1.0, descAC, descX, -1.0, descB );
                dparam[IPARAM_RES] = MORSE_zlange_Tile(MorseInfNorm, descB);
63 64 65 66 67

        PASTE_CODE_FREE_MATRIX( descB  );
        PASTE_CODE_FREE_MATRIX( descAC );
        PASTE_CODE_FREE_MATRIX( descX  );

68 69
    }

70 71 72 73
    PASTE_CODE_FREE_MATRIX( descA );

    return 0;
}