MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
time_zgetrf_tile.c File Reference
#include "./timing.c"
Include dependency graph for time_zgetrf_tile.c:

Go to the source code of this file.

Macros

#define _TYPE   PLASMA_Complex64_t
#define _PREC   double
#define _LAMCH   LAPACKE_dlamch_work
#define _NAME   "PLASMA_zgetrf_Tile"
#define _FMULS   (n * (1.0 / 3.0 * n ) * n)
#define _FADDS   (n * (1.0 / 3.0 * n - 0.5) * n)

Functions

static int RunTest (int *iparam, double *dparam, real_Double_t *t_)

Macro Definition Documentation

#define _FADDS   (n * (1.0 / 3.0 * n - 0.5) * n)

Definition at line 13 of file time_zgetrf_tile.c.

#define _FMULS   (n * (1.0 / 3.0 * n ) * n)

Definition at line 12 of file time_zgetrf_tile.c.

#define _LAMCH   LAPACKE_dlamch_work

Definition at line 8 of file time_zgetrf_tile.c.

#define _NAME   "PLASMA_zgetrf_Tile"

Definition at line 10 of file time_zgetrf_tile.c.

#define _PREC   double

Definition at line 7 of file time_zgetrf_tile.c.

#define _TYPE   PLASMA_Complex64_t

normal z -> c d s

Definition at line 6 of file time_zgetrf_tile.c.


Function Documentation

static int RunTest ( int *  iparam,
double *  dparam,
real_Double_t t_ 
)
static

Definition at line 18 of file time_zgetrf_tile.c.

References A, AT, cWtime(), L, MAGMA_CUDA, MAGMA_Desc_Create(), MAGMA_Desc_Destroy(), MAGMA_Disable(), MAGMA_Enable(), MAGMA_PROFILING_MODE, MAGMA_zgetrf_Tile(), MAGMA_zgetrs_Tile(), MAGMA_zLapack_to_Tile(), MAGMA_zplrnt_Tile(), MAGMA_zTile_to_Lapack(), morse_schedprofile_display(), morse_zdisplay_allprofile(), morse_zlocality_allrestore(), morse_zlocality_allrestrict(), TIMING_ANORM, TIMING_BNORM, TIMING_CHECK, TIMING_IB, TIMING_N, TIMING_NB, TIMING_NO_CPU, TIMING_NRHS, TIMING_PEAK, TIMING_PROFILE, TIMING_RES, TIMING_XNORM, and zcheck_solution().

{
PLASMA_Complex64_t *A, *AT, *b, *bT, *x, *L;
magma_desc_t *descA, *descB, *descL;
int *piv;
int nb, nb2, nt, ib;
int n = iparam[TIMING_N];
int nrhs = iparam[TIMING_NRHS];
int check = iparam[TIMING_CHECK];
int nocpu = iparam[TIMING_NO_CPU];
int lda = n;
int ldb = n;
int peak_profiling = iparam[TIMING_PEAK];
int profiling = iparam[TIMING_PROFILE];
nb = iparam[TIMING_NB];
ib = iparam[TIMING_IB];
nb2 = nb * nb;
nt = n / nb + ((n % nb == 0) ? 0 : 1);
/* Allocate Data */
AT = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( !AT ){
printf("Out of Memory \n ");
exit(0);
}
/* Initialiaze Data */
MAGMA_Desc_Create(&descA, AT, PlasmaComplexDouble, nb, nb, nb*nb, lda, n, 0, 0, n, n);
MAGMA_zplrnt_Tile(descA, 51 );
/* Allocate Workspace */
//MAGMA_Alloc_Workspace_zgesv_Tile(n, &descL, &piv);
piv = (int *)malloc ( nt*nt*nb*sizeof(int) );
L = (PLASMA_Complex64_t *)malloc( nt*nt*2*ib*nb*sizeof(PLASMA_Complex64_t) );
MAGMA_Desc_Create(&descL, L, PlasmaComplexDouble, 2*ib, nb, 2*ib*nb, nt*2*ib, nt*nb, 0, 0, nt*2*ib, nt*nb );
/* Save AT in lapack layout for check */
if ( check ) {
A = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
MAGMA_zTile_to_Lapack(descA, (void*)A, lda);
}
if ( profiling | peak_profiling )
if (nocpu)
/* if (iparam[TIMING_BOUND]) */
/* starpu_bound_start(iparam[TIMING_BOUNDDEPS],iparam[TIMING_BOUNDDEPSPRIO]); */
t = -cWtime();
MAGMA_zgetrf_Tile( descA, descL, piv );
t += cWtime();
/* if (iparam[TIMING_BOUND]) */
/* starpu_bound_stop(); */
*t_ = t;
if (nocpu)
if ( profiling | peak_profiling )
/* Check the solution */
if ( check )
{
b = (PLASMA_Complex64_t *)malloc(ldb*nrhs*sizeof(PLASMA_Complex64_t));
bT = (PLASMA_Complex64_t *)malloc(ldb*nrhs*sizeof(PLASMA_Complex64_t));
x = (PLASMA_Complex64_t *)malloc(ldb*nrhs*sizeof(PLASMA_Complex64_t));
MAGMA_Desc_Create(&descB, bT, PlasmaComplexDouble, nb, nb, nb*nb, n, nrhs, 0, 0, n, nrhs);
MAGMA_zplrnt_Tile(descB, 51 );
MAGMA_zLapack_to_Tile((void*)b, n, descB);
MAGMA_zgetrs_Tile( descA, descL, piv, descB );
MAGMA_zTile_to_Lapack(descB, (void*)x, n);
dparam[TIMING_RES] = zcheck_solution(n, n, nrhs, A, lda, b, x, ldb,
&(dparam[TIMING_ANORM]), &(dparam[TIMING_BNORM]),
&(dparam[TIMING_XNORM]));
free( A ); free( b ); free( bT ); free( x );
}
/* Deallocate Workspace */
//MAGMA_Dealloc_Handle_Tile(&descL);
free( L );
free( AT );
free( piv );
if (profiling)
{
/* Profiling of the scheduler */
/* Profile of each kernel */
}
return 0;
}

Here is the call graph for this function: