36 char *
formatstr[6]= {
"CM",
"RM",
"CCRB",
"CRRB",
"RCRB",
"RRRB"};
39 char *
diagstr[2] = {
"NonUnit",
"Unit " };
41 char *
itypestr[3] = {
"inv(U')xAxinv(U) or inv(L)xAxinv(L')",
"UxAxU' or L'xAxL",
"UxAxU' or L'xAxL" };
44 #define map_cm(m, n, i, j) ((i) + (j) * (m))
45 #define map_rm(m, n, i, j) ((i) * (n) + (j))
47 int map_CM(
int m,
int n,
int mb,
int nb,
int i,
int j) {
return map_cm(m, n, i, j); }
48 int map_RM(
int m,
int n,
int mb,
int nb,
int i,
int j) {
return map_rm(m, n, i, j); }
49 int map_CCRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
55 return (
map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_cm( mb, nb, i%mb, j%nb) );
58 return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) +
map_cm( m%mb, nb, i%mb, j%nb) );
62 return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_cm( mb, n%nb, i%mb, j%nb) );
65 return ( m*n0 + (n-n0)*m0 +
map_cm( m%mb, n%nb, i%mb, j%nb) );
68 int map_CRRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
74 return (
map_cm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_rm( mb, nb, i%mb, j%nb) );
77 return ( m0*n0 + ( (j/nb) * (nb*(m%mb)) ) +
map_rm( m%mb, nb, i%mb, j%nb) );
81 return ( m*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_rm( mb, n%nb, i%mb, j%nb) );
84 return ( m*n0 + (n-n0)*m0 +
map_rm( m%mb, n%nb, i%mb, j%nb) );
87 int map_RCRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
93 return (
map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_cm( mb, nb, i%mb, j%nb) );
96 return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) +
map_cm( m%mb, nb, i%mb, j%nb) );
100 return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_cm( mb, n%nb, i%mb, j%nb) );
103 return ( m*n0 + (n-n0)*m0 +
map_cm( m%mb, n%nb, i%mb, j%nb) );
106 int map_RRRB(
int m,
int n,
int mb,
int nb,
int i,
int j) {
112 return (
map_rm( m/mb, n/nb, i/mb, j/nb )*mb*nb +
map_rm( mb, nb, i%mb, j%nb) );
115 return ( m0*n + ( (j/nb) * (nb*(m%mb)) ) +
map_rm( m%mb, nb, i%mb, j%nb) );
119 return ( m0*n0 + ( (i/mb) * (mb*(n%nb)) ) +
map_rm( mb, n%nb, i%mb, j%nb) );
122 return ( m*n0 + (n-n0)*m0 +
map_rm( m%mb, n%nb, i%mb, j%nb) );
127 int main (
int argc,
char **argv)
135 printf(
" Proper Usage is : ./ctesting ncores sched FUNC ...\n"
136 " - ncores : number of cores \n"
137 " - sched : 0 for static, 1 for dynamic\n"
138 " - FUNC : name of function to test\n");
142 sscanf( argv[1],
"%d", &ncores );
143 sscanf( argv[2],
"%d", &sched );
144 sscanf( argv[3],
"%s", func );
159 if ( strcmp(func,
"LANGE") == 0 ) {
164 }
else if ( strcmp(func,
"GEMM") == 0 ) {
167 }
else if ( strcmp(func,
"HEMM") == 0 ) {
169 }
else if ( strcmp(func,
"HERK") == 0 ) {
171 }
else if ( strcmp(func,
"HER2K") == 0 ) {
174 }
else if ( strcmp(func,
"SYMM") == 0 ) {
176 }
else if ( strcmp(func,
"SYRK") == 0 ) {
178 }
else if ( strcmp(func,
"SYR2K") == 0 ) {
180 }
else if ( strcmp(func,
"TRMM") == 0 ) {
182 }
else if ( strcmp(func,
"TRSM") == 0 ) {
184 }
else if ( strcmp(func,
"PEMV") == 0 ) {
189 }
else if ( strcmp(func,
"POSV") == 0 ) {
191 }
else if ( strcmp(func,
"GELS") == 0 ) {
193 }
else if ( strcmp(func,
"GESV") == 0 ) {
198 }
else if ( strcmp(func,
"POTRI") == 0 ) {
200 }
else if ( strcmp(func,
"GETRI") == 0 ) {
205 }
else if ( strcmp(func,
"HEEV") == 0 ) {
207 }
else if ( strcmp(func,
"HEGV") == 0 ) {
209 }
else if ( strcmp(func,
"HEGST") == 0 ) {
214 }
else if ( strcmp(func,
"GESVD") == 0 ) {
220 }
else if ( strcmp(func,
"CPOSV") == 0 ) {
221 info = testing_ccposv( argc, argv );
222 }
else if ( strcmp(func,
"CGESV") == 0 ) {
223 info = testing_ccgesv( argc, argv );
224 }
else if ( strcmp(func,
"CUNGESV") == 0 ) {
225 info = testing_ccungesv( argc, argv );
228 }
else if ( strcmp(func,
"GECFI") == 0 ) {
230 }
else if ( strcmp(func,
"GETMI") == 0 ) {
233 fprintf(stderr,
"Function unknown\n");
237 printf(
"TESTING %s FAILED : incorrect number of arguments\n", func);
238 }
else if ( info == -2 ) {
239 printf(
"TESTING %s FAILED : not enough memory\n", func);