time_zgesvd_tile.c 1.94 KB
Newer Older
1
/**
2 3
 *
 * @file time_zgesvd_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
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
10
 ***
11
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
12
 * @version 1.0.0
13 14
 * @precisions normal z -> c d s
 *
15
 */
16 17 18 19
#define _TYPE  MORSE_Complex64_t
#define _PREC  double
#define _LAMCH LAPACKE_dlamch_work

Mathieu Faverge's avatar
Minor  
Mathieu Faverge committed
20
#define _NAME  "MORSE_zheev_Tile"
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
/* See Lawn 41 page 120 */
#define _FMULS FMULS_GEBRD( M, N )
#define _FADDS FADDS_GEBRD( M, N )

#include "./timing.c"

static int
RunTest(int *iparam, double *dparam, morse_time_t *t_)
{
    PASTE_CODE_IPARAM_LOCALS( iparam );
    MORSE_desc_t *descT;
    int jobu  = MorseVec;
    int jobvt = MorseVec;
    int INFO;

    /* Allocate Data */
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, MORSE_Complex64_t, MorseComplexDouble, LDA, M, N );
    PASTE_CODE_ALLOCATE_MATRIX( VT, (jobvt == MorseVec), MORSE_Complex64_t, N, N );
39
    PASTE_CODE_ALLOCATE_MATRIX( U,  (jobu  == MorseVec), MORSE_Complex64_t, M, M );
40 41 42 43 44 45 46 47 48
    PASTE_CODE_ALLOCATE_MATRIX( S, 1, double, N, 1 );

    /* Initialiaze Data */
    MORSE_zplrnt_Tile(descA, 51 );

    /* Allocate Workspace */
    MORSE_Alloc_Workspace_zgesvd(N, N, &descT, 1, 1);

    if ( jobu == MorseVec ) {
49
        LAPACKE_zlaset_work(LAPACK_COL_MAJOR, 'A', M, M, 0., 1., U,  M);
50 51 52 53 54 55 56 57 58
    }
    if ( jobvt == MorseVec ) {
        LAPACKE_zlaset_work(LAPACK_COL_MAJOR, 'A', N, N, 0., 1., VT, N);
    }

    START_TIMING();
    INFO = MORSE_zgesvd_Tile(jobu, jobvt, descA, S, descT, U, M, VT, N);
    STOP_TIMING();

59 60
    if( INFO != 0 ) {
        printf(" ERROR OCCURED INFO %d\n",INFO);
61 62 63 64 65
    }

    /* DeAllocate Workspace */
    MORSE_Dealloc_Workspace(&descT);

66 67
    if ( U != NULL ) {
        free( U );
68
    }
69 70
    if ( VT != NULL) {
        free( VT );
71 72 73
    }
    PASTE_CODE_FREE_MATRIX( descA );
    free( S );
Mathieu Faverge's avatar
Mathieu Faverge committed
74 75

    (void)dparam;
76 77
    return 0;
}