PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
testing_cmain.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <plasma.h>
#include "testing_cmain.h"
Include dependency graph for testing_cmain.c:

Go to the source code of this file.

Macros

#define COMPLEX
#define SINGLE
#define map_cm(m, n, i, j)   ((i) + (j) * (m))
#define map_rm(m, n, i, j)   ((i) * (n) + (j))

Functions

int map_CM (int m, int n, int mb, int nb, int i, int j)
int map_RM (int m, int n, int mb, int nb, int i, int j)
int map_CCRB (int m, int n, int mb, int nb, int i, int j)
int map_CRRB (int m, int n, int mb, int nb, int i, int j)
int map_RCRB (int m, int n, int mb, int nb, int i, int j)
int map_RRRB (int m, int n, int mb, int nb, int i, int j)
int main (int argc, char **argv)

Variables

int IONE = 1
int ISEED [4] = {0,0,0,1}
int format [6] = { PlasmaCM, PlasmaRM, PlasmaCCRB, PlasmaCRRB, PlasmaRCRB, PlasmaRRRB }
int side [2] = { PlasmaLeft, PlasmaRight }
int uplo [2] = { PlasmaUpper, PlasmaLower }
int diag [2] = { PlasmaNonUnit, PlasmaUnit }
int trans [3] = { PlasmaNoTrans, PlasmaTrans, PlasmaConjTrans }
int itype [3] = { 1, 2, 3 }
int storev [2] = { PlasmaRowwise, PlasmaColumnwise }
char * formatstr [6] = { "CM", "RM", "CCRB", "CRRB", "RCRB", "RRRB"}
char * sidestr [2] = { "Left ", "Right" }
char * uplostr [2] = { "Upper", "Lower" }
char * diagstr [2] = { "NonUnit", "Unit " }
char * transstr [3] = { "N", "T", "H" }
char * itypestr [3] = { "inv(U')xAxinv(U) or inv(L)xAxinv(L')", "UxAxU' or L'xAxL", "UxAxU' or L'xAxL" }
char * storevstr [2] = { "Rowwise", "Columnwise" }
void * formatmap [6] = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB }

Detailed Description

PLASMA testing routines PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

Version:
2.4.5
Author:
Mathieu Faverge
Date:
2010-11-15 c Tue Nov 22 14:35:48 2011

Definition in file testing_cmain.c.


Macro Definition Documentation

#define COMPLEX

Definition at line 20 of file testing_cmain.c.

#define map_cm (   m,
  n,
  i,
 
)    ((i) + (j) * (m))

Definition at line 44 of file testing_cmain.c.

#define map_rm (   m,
  n,
  i,
 
)    ((i) * (n) + (j))

Definition at line 45 of file testing_cmain.c.

#define SINGLE

Definition at line 22 of file testing_cmain.c.


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 127 of file testing_cmain.c.

References PLASMA_DYNAMIC_SCHEDULING, PLASMA_Finalize(), PLASMA_Init(), PLASMA_SCHEDULING_MODE, PLASMA_Set(), PLASMA_STATIC_SCHEDULING, plasma_testing::sched, testing_cgecfi(), testing_cgels(), testing_cgemm(), testing_cgesv(), testing_cgesvd(), testing_cgetmi(), testing_cgetri(), testing_cheev(), testing_chegst(), testing_chegv(), testing_chemm(), testing_cher2k(), testing_cherk(), testing_clange(), testing_cpemv(), testing_cposv(), testing_cpotri(), testing_csymm(), testing_csyr2k(), testing_csyrk(), testing_ctrmm(), and testing_ctrsm().

{
int ncores, sched;
int info;
char func[32];
/* Check for number of arguments*/
if ( argc < 4) {
printf(" Proper Usage is : ./ctesting ncores sched FUNC ...\n"
" - ncores : number of cores \n"
" - sched : 0 for static, 1 for dynamic\n"
" - FUNC : name of function to test\n");
exit(1);
}
sscanf( argv[1], "%d", &ncores );
sscanf( argv[2], "%d", &sched );
sscanf( argv[3], "%s", func );
PLASMA_Init(ncores);
if ( sched == 0 )
else
argc -= 4;
argv += 4;
info = 0;
/*
* Norms
*/
if ( strcmp(func, "LANGE") == 0 ) {
info = testing_clange( argc, argv );
/*
* Blas Level 3
*/
} else if ( strcmp(func, "GEMM") == 0 ) {
info = testing_cgemm( argc, argv );
#ifdef COMPLEX
} else if ( strcmp(func, "HEMM") == 0 ) {
info = testing_chemm( argc, argv );
} else if ( strcmp(func, "HERK") == 0 ) {
info = testing_cherk( argc, argv );
} else if ( strcmp(func, "HER2K") == 0 ) {
info = testing_cher2k( argc, argv );
#endif
} else if ( strcmp(func, "SYMM") == 0 ) {
info = testing_csymm( argc, argv );
} else if ( strcmp(func, "SYRK") == 0 ) {
info = testing_csyrk( argc, argv );
} else if ( strcmp(func, "SYR2K") == 0 ) {
info = testing_csyr2k( argc, argv );
} else if ( strcmp(func, "TRMM") == 0 ) {
info = testing_ctrmm( argc, argv );
} else if ( strcmp(func, "TRSM") == 0 ) {
info = testing_ctrsm( argc, argv );
} else if ( strcmp(func, "PEMV") == 0 ) {
info = testing_cpemv( argc, argv );
/*
* Linear system
*/
} else if ( strcmp(func, "POSV") == 0 ) {
info = testing_cposv( argc, argv );
} else if ( strcmp(func, "GELS") == 0 ) {
info = testing_cgels( argc, argv );
} else if ( strcmp(func, "GESV") == 0 ) {
info = testing_cgesv( argc, argv );
/*
* Matrix inversion
*/
} else if ( strcmp(func, "POTRI") == 0 ) {
info = testing_cpotri( argc, argv );
} else if ( strcmp(func, "GETRI") == 0 ) {
info = testing_cgetri( argc, argv );
/*
* Eigenvalue Problems
*/
} else if ( strcmp(func, "HEEV") == 0 ) {
info = testing_cheev( argc, argv );
} else if ( strcmp(func, "HEGV") == 0 ) {
info = testing_chegv( argc, argv );
} else if ( strcmp(func, "HEGST") == 0 ) {
info = testing_chegst( argc, argv );
/*
* Singular Value Decomposition
*/
} else if ( strcmp(func, "GESVD") == 0 ) {
info = testing_cgesvd( argc, argv );
#ifdef DOUBLE
/*
* Mixed precision
*/
} else if ( strcmp(func, "CPOSV") == 0 ) {
info = testing_ccposv( argc, argv );
} else if ( strcmp(func, "CGESV") == 0 ) {
info = testing_ccgesv( argc, argv );
} else if ( strcmp(func, "CUNGESV") == 0 ) {
info = testing_ccungesv( argc, argv );
#endif
/* Layout Transformation */
} else if ( strcmp(func, "GECFI") == 0 ) {
info = testing_cgecfi( argc, argv );
} else if ( strcmp(func, "GETMI") == 0 ) {
info = testing_cgetmi( argc, argv );
} else {
fprintf(stderr, "Function unknown\n");
}
if ( info == -1 ) {
printf( "TESTING %s FAILED : incorrect number of arguments\n", func);
} else if ( info == -2 ) {
printf( "TESTING %s FAILED : not enough memory\n", func);
}
return EXIT_SUCCESS;
}

Here is the call graph for this function:

int map_CCRB ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 49 of file testing_cmain.c.

{
int m0 = m - m%mb;
int n0 = n - n%nb;
if ( j < n0 )
if (i < m0)
/* Case in A11 */
return ( map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb + map_cm( mb, nb, i%mb, j%nb) );
else
/* Case in A21 */
return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) + map_cm( m%mb, nb, i%mb, j%nb) );
else
if (i < m0)
/* Case in A12 */
return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) + map_cm( mb, n%nb, i%mb, j%nb) );
else
/* Case in A22 */
return ( m*n0 + (n-n0)*m0 + map_cm( m%mb, n%nb, i%mb, j%nb) );
}
int map_CM ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 47 of file testing_cmain.c.

{ return map_cm(m, n, i, j); }
int map_CRRB ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 68 of file testing_cmain.c.

{
int m0 = m - m%mb;
int n0 = n - n%nb;
if ( j < n0 )
if (i < m0)
/* Case in A11 */
return ( map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb + map_rm( mb, nb, i%mb, j%nb) );
else
/* Case in A21 */
return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) + map_rm( m%mb, nb, i%mb, j%nb) );
else
if (i < m0)
/* Case in A12 */
return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) + map_rm( mb, n%nb, i%mb, j%nb) );
else
/* Case in A22 */
return ( m*n0 + (n-n0)*m0 + map_rm( m%mb, n%nb, i%mb, j%nb) );
}
int map_RCRB ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 87 of file testing_cmain.c.

{
int m0 = m - m%mb;
int n0 = n - n%nb;
if ( j < n0 )
if (i < m0)
/* Case in A11 */
return ( map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb + map_cm( mb, nb, i%mb, j%nb) );
else
/* Case in A21 */
return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) + map_cm( m%mb, nb, i%mb, j%nb) );
else
if (i < m0)
/* Case in A12 */
return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) + map_cm( mb, n%nb, i%mb, j%nb) );
else
/* Case in A22 */
return ( m*n0 + (n-n0)*m0 + map_cm( m%mb, n%nb, i%mb, j%nb) );
}
int map_RM ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 48 of file testing_cmain.c.

{ return map_rm(m, n, i, j); }
int map_RRRB ( int  m,
int  n,
int  mb,
int  nb,
int  i,
int  j 
)

Definition at line 106 of file testing_cmain.c.

{
int m0 = m - m%mb;
int n0 = n - n%nb;
if ( j < n0 )
if (i < m0)
/* Case in A11 */
return ( map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb + map_rm( mb, nb, i%mb, j%nb) );
else
/* Case in A21 */
return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) + map_rm( m%mb, nb, i%mb, j%nb) );
else
if (i < m0)
/* Case in A12 */
return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) + map_rm( mb, n%nb, i%mb, j%nb) );
else
/* Case in A22 */
return ( m*n0 + (n-n0)*m0 + map_rm( m%mb, n%nb, i%mb, j%nb) );
}

Variable Documentation

int diag[2] = { PlasmaNonUnit, PlasmaUnit }

Definition at line 31 of file testing_cmain.c.

char* diagstr[2] = { "NonUnit", "Unit " }

Definition at line 39 of file testing_cmain.c.

Definition at line 28 of file testing_cmain.c.

void* formatmap[6] = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB }

Definition at line 125 of file testing_cmain.c.

char* formatstr[6] = { "CM", "RM", "CCRB", "CRRB", "RCRB", "RRRB"}

Definition at line 36 of file testing_cmain.c.

int IONE = 1

Definition at line 25 of file testing_cmain.c.

int ISEED[4] = {0,0,0,1}

Definition at line 26 of file testing_cmain.c.

int itype[3] = { 1, 2, 3 }

Definition at line 33 of file testing_cmain.c.

char* itypestr[3] = { "inv(U')xAxinv(U) or inv(L)xAxinv(L')", "UxAxU' or L'xAxL", "UxAxU' or L'xAxL" }

Definition at line 41 of file testing_cmain.c.

int side[2] = { PlasmaLeft, PlasmaRight }

Definition at line 29 of file testing_cmain.c.

char* sidestr[2] = { "Left ", "Right" }

Definition at line 37 of file testing_cmain.c.

int storev[2] = { PlasmaRowwise, PlasmaColumnwise }

Definition at line 34 of file testing_cmain.c.

char* storevstr[2] = { "Rowwise", "Columnwise" }

Definition at line 42 of file testing_cmain.c.

Definition at line 32 of file testing_cmain.c.

char* transstr[3] = { "N", "T", "H" }

Definition at line 40 of file testing_cmain.c.

int uplo[2] = { PlasmaUpper, PlasmaLower }

Definition at line 30 of file testing_cmain.c.

char* uplostr[2] = { "Upper", "Lower" }

Definition at line 38 of file testing_cmain.c.