time_zgesvd_tile.c 1.97 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.
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_zheev_Tile"
21 22 23 24 25 26 27
/* See Lawn 41 page 120 */
#define _FMULS FMULS_GEBRD( M, N )
#define _FADDS FADDS_GEBRD( M, N )

#include "./timing.c"

static int
Mathieu Faverge's avatar
Mathieu Faverge committed
28
RunTest(int *iparam, double *dparam, chameleon_time_t *t_)
29 30
{
    PASTE_CODE_IPARAM_LOCALS( iparam );
31 32 33
    CHAM_desc_t *descT;
    int jobu  = ChamVec;
    int jobvt = ChamVec;
34 35 36
    int INFO;

    /* Allocate Data */
37 38 39
    PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, CHAMELEON_Complex64_t, ChamComplexDouble, LDA, M, N );
    PASTE_CODE_ALLOCATE_MATRIX( VT, (jobvt == ChamVec), CHAMELEON_Complex64_t, N, N );
    PASTE_CODE_ALLOCATE_MATRIX( U,  (jobu  == ChamVec), CHAMELEON_Complex64_t, M, M );
40 41
    PASTE_CODE_ALLOCATE_MATRIX( S, 1, double, N, 1 );

42
    /* Initialize Data */
43
    CHAMELEON_zplrnt_Tile(descA, 51 );
44 45

    /* Allocate Workspace */
46
    CHAMELEON_Alloc_Workspace_zgesvd(N, N, &descT, 1, 1);
47

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

    START_TIMING();
56
    INFO = CHAMELEON_zgesvd_Tile(jobu, jobvt, descA, S, descT, U, M, VT, N);
57 58
    STOP_TIMING();

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

    /* DeAllocate Workspace */
64
    CHAMELEON_Dealloc_Workspace(&descT);
65

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;
}