time_zgesvd_tile.c 2.02 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.
PRUVOST Florent's avatar
PRUVOST Florent committed
7
 * @copyright 2012-2019 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8
 *                      Univ. Bordeaux. All rights reserved.
9
 *
10
 ***
11
 *
PRUVOST Florent's avatar
PRUVOST Florent committed
12 13 14
 * @version 0.9.2
 * @author Mathieu Faverge
 * @date 2016-12-09
15 16
 * @precisions normal z -> c d s
 *
17
 */
18
#define _TYPE  CHAMELEON_Complex64_t
19 20 21
#define _PREC  double
#define _LAMCH LAPACKE_dlamch_work

22
#define _NAME  "CHAMELEON_zheev_Tile"
23 24 25 26 27 28 29
/* 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
30
RunTest(int *iparam, double *dparam, chameleon_time_t *t_)
31 32
{
    PASTE_CODE_IPARAM_LOCALS( iparam );
33 34 35
    CHAM_desc_t *descT;
    int jobu  = ChamVec;
    int jobvt = ChamVec;
36 37 38
    int INFO;

    /* Allocate Data */
39 40 41
    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 );
42 43
    PASTE_CODE_ALLOCATE_MATRIX( S, 1, double, N, 1 );

44
    /* Initialize Data */
45
    CHAMELEON_zplrnt_Tile(descA, 51 );
46 47

    /* Allocate Workspace */
48
    CHAMELEON_Alloc_Workspace_zgesvd(N, N, &descT, 1, 1);
49

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

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

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

    /* DeAllocate Workspace */
66
    CHAMELEON_Dealloc_Workspace(&descT);
67

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

    (void)dparam;
78 79
    return 0;
}