35 USAGE(
"SYRK",
"alpha beta M N LDA LDC",
36 " - alpha : alpha coefficient\n"
37 " - beta : beta coefficient\n"
38 " - N : number of columns and rows of matrix C and number of row of matrix A\n"
39 " - K : number of columns of matrix A\n"
40 " - LDA : leading dimension of matrix A\n"
41 " - LDC : leading dimension of matrix C\n");
47 int N = atoi(argv[2]);
48 int K = atoi(argv[3]);
49 int LDA = atoi(argv[4]);
50 int LDC = atoi(argv[5]);
51 int NKmax =
max(N, K);
56 size_t LDAxK = LDA*NKmax;
65 if ( (!A) || (!Cinit) || (!Cfinal) ){
66 printf(
"Out of Memory \n ");
70 eps = LAPACKE_slamch_work(
'e');
73 printf(
"------ TESTS FOR PLASMA CSYRK ROUTINE ------- \n");
74 printf(
" Size of the Matrix A %d by %d\n", N, K);
76 printf(
" The matrix A is randomly generated for each test.\n");
77 printf(
"============\n");
78 printf(
" The relative machine precision (eps) is to be %e \n",eps);
79 printf(
" Computational tests pass if scaled residuals are less than 10.\n");
86 LAPACKE_clarnv_work(
IONE,
ISEED, LDAxK, A);
101 alpha, A, LDA, beta, Cinit, Cfinal, LDC);
103 if (info_solution == 0) {
104 printf(
"***************************************************\n");
105 printf(
" ---- TESTING CSYRK (%5s, %s) ........... PASSED !\n",
uplostr[u],
transstr[t]);
106 printf(
"***************************************************\n");
109 printf(
"************************************************\n");
110 printf(
" - TESTING CSYRK (%5s, %s) ... FAILED !\n",
uplostr[u],
transstr[t]);
111 printf(
"************************************************\n");
117 free(Cinit); free(Cfinal);
131 float Anorm, Cinitnorm, Cplasmanorm, Clapacknorm, Rnorm;
135 float *work = (
float *)malloc(
max(N, K)*
sizeof(float));
153 eps = LAPACKE_slamch_work(
'e');
155 printf(
"Rnorm %e, Anorm %e, Cinitnorm %e, Cplasmanorm %e, Clapacknorm %e\n",
156 Rnorm, Anorm, Cinitnorm, Cplasmanorm, Clapacknorm);
158 result = Rnorm / ((Anorm + Cinitnorm) * N * eps);
160 printf(
"============\n");
161 printf(
"Checking the norm of the difference against reference CSYRK \n");
162 printf(
"-- ||Cplasma - Clapack||_oo/((||A||_oo+||C||_oo).N.eps) = %e \n", result);
164 if ( isinf(Clapacknorm) || isinf(Cplasmanorm) || isnan(result) || isinf(result) || (result > 10.0) ) {
165 printf(
"-- The solution is suspicious ! \n");
169 printf(
"-- The solution is CORRECT ! \n");
175 return info_solution;