29 #if defined( _WIN32 ) || defined( _WIN64 ) 33 #include <sys/resource.h> 45 int format[6]= { MorseCM, MorseRM, MorseCCRB, MorseCRRB, MorseRCRB, MorseRRRB };
46 int side[2] = { MorseLeft, MorseRight };
47 int uplo[2] = { MorseUpper, MorseLower };
48 int diag[2] = { MorseNonUnit, MorseUnit };
49 int trans[3] = { MorseNoTrans, MorseTrans, MorseConjTrans };
51 int storev[2] = { MorseRowwise, MorseColumnwise };
52 int norm[4] = { MorseMaxNorm, MorseOneNorm, MorseInfNorm, MorseFrobeniusNorm };
54 char *
formatstr[6]= {
"CM",
"RM",
"CCRB",
"CRRB",
"RCRB",
"RRRB"};
57 char *
diagstr[2] = {
"NonUnit",
"Unit " };
59 char *
itypestr[3] = {
"inv(U')xAxinv(U) or inv(L)xAxinv(L')",
"UxAxU' or L'xAxL",
"UxAxU' or L'xAxL" };
61 char *
normstr[4] = {
"Max",
"One",
"Inf",
"Fro" };
63 #define map_cm(m, n, i, j) ((i) + (j) * (m)) 64 #define map_rm(m, n, i, j) ((i) * (n) + (j)) 66 int map_CM(
int m,
int n,
int mb,
int nb,
int i,
int j)
68 int hres =
map_cm(m, n, i, j);
75 int map_RM(
int m,
int n,
int mb,
int nb,
int i,
int j)
77 int hres =
map_rm(m, n, i, j);
84 int map_CCRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
90 return (
map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_cm( mb, nb, i%mb, j%nb) );
93 return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) +
map_cm( m%mb, nb, i%mb, j%nb) );
97 return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_cm( mb, n%nb, i%mb, j%nb) );
100 return ( m*n0 + (n-n0)*m0 +
map_cm( m%mb, n%nb, i%mb, j%nb) );
103 int map_CRRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
109 return (
map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_rm( mb, nb, i%mb, j%nb) );
112 return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) +
map_rm( m%mb, nb, i%mb, j%nb) );
116 return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_rm( mb, n%nb, i%mb, j%nb) );
119 return ( m*n0 + (n-n0)*m0 +
map_rm( m%mb, n%nb, i%mb, j%nb) );
122 int map_RCRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
128 return (
map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_cm( mb, nb, i%mb, j%nb) );
131 return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) +
map_cm( m%mb, nb, i%mb, j%nb) );
135 return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_cm( mb, n%nb, i%mb, j%nb) );
138 return ( m*n0 + (n-n0)*m0 +
map_cm( m%mb, n%nb, i%mb, j%nb) );
141 int map_RRRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
147 return (
map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_rm( mb, nb, i%mb, j%nb) );
150 return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) +
map_rm( m%mb, nb, i%mb, j%nb) );
154 return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_rm( mb, n%nb, i%mb, j%nb) );
157 return ( m*n0 + (n-n0)*m0 +
map_rm( m%mb, n%nb, i%mb, j%nb) );
160 int (*
formatmap[6])(int, int, int, int, int, int) = {
map_CM,
map_RM,
map_CCRB,
map_CRRB,
map_RCRB,
map_RRRB };
162 int main (
int argc,
char **argv)
170 printf(
" Proper Usage is : ./ztesting ncores ngpus FUNC ...\n" 171 " - ncores : number of cores\n" 172 " - ngpus : number of GPUs\n" 173 " - FUNC : name of function to test\n" 174 " - ... plus arguments depending on the testing function \n");
178 sscanf( argv[1],
"%d", &ncores );
179 sscanf( argv[2],
"%d", &ngpus );
180 sscanf( argv[3],
"%31s", func );
186 MORSE_Init( ncores, ngpus);
187 MORSE_Disable(MORSE_AUTOTUNING);
188 MORSE_Set(MORSE_TILE_SIZE, 32 );
189 MORSE_Set(MORSE_INNER_BLOCK_SIZE, 5 );
198 if ( strcmp(func,
"posv") == 0 ) {
201 else if ( strcmp(func,
"trsmd") == 0 ) {
205 fprintf(stderr,
"Function unknown\n");
209 printf(
"TESTING %s FAILED : incorrect number of arguments\n", func);
210 }
else if ( info == -2 ) {
211 printf(
"TESTING %s FAILED : not enough memory\n", func);
int map_CRRB(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)
#define map_cm(m, n, i, j)
int main(int argc, char **argv)
int map_RCRB(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(* formatmap[6])(int, int, int, int, int, int)
int testing_dtrsmd(int argc, char **argv)
#define map_rm(m, n, i, j)
int map_CM(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 testing_dposv(int argc, char **argv)