MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
time_zgemm_tile.c File Reference
#include "./timing.c"
Include dependency graph for time_zgemm_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   "MAGMA_zgemm_Tile"
#define _FMULS   (n * n * n )
#define _FADDS   (n * n * n )

Functions

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

Macro Definition Documentation

#define _FADDS   (n * n * n )

Definition at line 13 of file time_zgemm_tile.c.

#define _FMULS   (n * n * n )

Definition at line 12 of file time_zgemm_tile.c.

#define _LAMCH   LAPACKE_dlamch_work

Definition at line 8 of file time_zgemm_tile.c.

#define _NAME   "MAGMA_zgemm_Tile"

Definition at line 10 of file time_zgemm_tile.c.

#define _PREC   double

Definition at line 7 of file time_zgemm_tile.c.

#define _TYPE   PLASMA_Complex64_t

normal z -> c d s

Definition at line 6 of file time_zgemm_tile.c.


Function Documentation

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

Definition at line 18 of file time_zgemm_tile.c.

References A, AT, B, C2, cWtime(), ISEED, MAGMA_Desc_Create(), MAGMA_Desc_Destroy(), MAGMA_zgemm_Tile(), MAGMA_zTile_to_Lapack(), TIMING_ANORM, TIMING_BNORM, TIMING_CHECK, TIMING_N, TIMING_NB, TIMING_RES, TIMING_XNORM, and zcheck_gemm().

{
PLASMA_Complex64_t *AT, *BT, *CT;
PLASMA_Complex64_t *A, *B, *C1, *C2;
PLASMA_Complex64_t alpha, beta;
magma_desc_t *descA, *descB, *descC;
int nb, nb2, nt;
int n = iparam[TIMING_N];
int check = iparam[TIMING_CHECK];
int lda = n;
/* Allocate Data */
nb = iparam[TIMING_NB];
nb2 = nb * nb;
nt = n / nb + ((n % nb == 0) ? 0 : 1);
AT = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
BT = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
CT = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!AT) || (!BT) || (!CT) ) {
printf("Out of Memory \n ");
exit(0);
}
/* Initialiaze Data */
LAPACKE_zlarnv_work(1, ISEED, 1, &alpha);
LAPACKE_zlarnv_work(1, ISEED, 1, &beta);
LAPACKE_zlarnv_work(1, ISEED, lda*n, AT);
LAPACKE_zlarnv_work(1, ISEED, lda*n, BT);
LAPACKE_zlarnv_work(1, ISEED, lda*n, CT);
/* Initialize AT and bT for Symmetric Positif Matrix */
MAGMA_Desc_Create(&descA, AT, PlasmaComplexDouble, nb, nb, nb*nb, n, n, 0, 0, n, n);
MAGMA_Desc_Create(&descB, BT, PlasmaComplexDouble, nb, nb, nb*nb, n, n, 0, 0, n, n);
MAGMA_Desc_Create(&descC, CT, PlasmaComplexDouble, nb, nb, nb*nb, n, n, 0, 0, n, n);
if (check)
{
C2 = (PLASMA_Complex64_t *)malloc(n*lda*sizeof(PLASMA_Complex64_t));
MAGMA_zTile_to_Lapack(descC, (void*)C2, n);
}
/* if (iparam[TIMING_BOUND]) */
/* starpu_bound_start(iparam[TIMING_BOUNDDEPS],iparam[TIMING_BOUNDDEPSPRIO]); */
t = -cWtime();
MAGMA_zgemm_Tile( PlasmaNoTrans, PlasmaNoTrans, alpha, descA, descB, beta, descC );
t += cWtime();
/* if (iparam[TIMING_BOUND]) */
/* starpu_bound_stop(); */
*t_ = t;
/* Check the solution */
if (check)
{
A = (PLASMA_Complex64_t *)malloc(n*lda*sizeof(PLASMA_Complex64_t));
MAGMA_zTile_to_Lapack(descA, (void*)A, n);
free(AT);
B = (PLASMA_Complex64_t *)malloc(n*lda*sizeof(PLASMA_Complex64_t));
MAGMA_zTile_to_Lapack(descB, (void*)B, n);
free(BT);
C1 = (PLASMA_Complex64_t *)malloc(n*lda*sizeof(PLASMA_Complex64_t));
MAGMA_zTile_to_Lapack(descC, (void*)C1, n);
free(CT);
dparam[TIMING_RES] = zcheck_gemm( PlasmaNoTrans, PlasmaNoTrans, n, n, n,
alpha, A, lda, B, lda, beta, C1, C2, lda,
&(dparam[TIMING_ANORM]), &(dparam[TIMING_BNORM]),
&(dparam[TIMING_XNORM]));
free(C2);
}
else {
free( AT );
free( BT );
free( CT );
}
return 0;
}

Here is the call graph for this function: