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_zmain.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define USAGE(name, args, details)
#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))

Functions

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 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 map_RM (int m, int n, int mb, int nb, int i, int j)
int testing_zgemm (int argc, char **argv)
int testing_zhemm (int argc, char **argv)
int testing_zsymm (int argc, char **argv)
int testing_zherk (int argc, char **argv)
int testing_zsyrk (int argc, char **argv)
int testing_zher2k (int argc, char **argv)
int testing_zsyr2k (int argc, char **argv)
int testing_ztrmm (int argc, char **argv)
int testing_ztrsm (int argc, char **argv)
int testing_zpemv (int argc, char **argv)
int testing_zposv (int argc, char **argv)
int testing_zgels (int argc, char **argv)
int testing_zgesv (int argc, char **argv)
int testing_zpotri (int argc, char **argv)
int testing_zgetri (int argc, char **argv)
int testing_zgeev (int argc, char **argv)
int testing_zgesvd (int argc, char **argv)
int testing_zheev (int argc, char **argv)
int testing_zhegv (int argc, char **argv)
int testing_zhegst (int argc, char **argv)
int testing_zgecfi (int argc, char **argv)
int testing_zgetmi (int argc, char **argv)
int testing_zlange (int argc, char **argv)

Variables

int IONE
int ISEED [4]
int format [6]
int trans [3]
int uplo [2]
int side [2]
int diag [2]
int itype [3]
int storev [2]
char * formatstr [6]
char * transstr [3]
char * uplostr [2]
char * sidestr [2]
char * diagstr [2]
char * itypestr [3]
char * storevstr [2]
void * formatmap [6]

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 normal z -> c d s

Definition in file testing_zmain.h.


Macro Definition Documentation

#define max (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 31 of file testing_zmain.h.

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 34 of file testing_zmain.h.

#define USAGE (   name,
  args,
  details 
)
Value:
printf(" Proper Usage is : ./ztesting ncores sched " name " " args " with\n" \
" - ncores : number of cores \n" \
" - sched : 0 for static, 1 for dynamic\n" \
" - " name " : name of function to test\n" \
details);

Definition at line 18 of file testing_zmain.h.


Function Documentation

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) );
}
int testing_zgecfi ( int  argc,
char **  argv 
)

Definition at line 89 of file testing_zgecfi.c.

References A, B, check_solution(), formatmap, formatstr, ISEED, PLASMA_DYNAMIC_SCHEDULING, PLASMA_Finalize(), PLASMA_Init(), PLASMA_SCHEDULING_MODE, PLASMA_Set(), PLASMA_SUCCESS, PLASMA_zgecfi(), PlasmaCM, and USAGE.

{
int m, n, mb, nb, mb2, nb2;
int i, ret, size;
int f1, f2;
/* Check for number of arguments*/
if (argc != 6){
USAGE("GECFI", "M N MB NB with \n",
" - M : the number of rows of the matrix \n"
" - N : the number of columns of the matrix \n"
" - MB : the number of rows of each block \n"
" - NB : the number of columns of each block \n"
" - MB2 : the number of rows of each block \n"
" - NB2 : the number of columns of each block \n");
return -1;
}
m = atoi(argv[0]);
n = atoi(argv[1]);
mb = atoi(argv[2]);
nb = atoi(argv[3]);
mb2 = atoi(argv[4]);
nb2 = atoi(argv[5]);
/* Initialize Plasma */
size = m*n*sizeof(PLASMA_Complex64_t);
A = (PLASMA_Complex64_t *)malloc(size);
B = (PLASMA_Complex64_t *)malloc(size);
LAPACKE_zlarnv_work(1, ISEED, m*n, A);
for(i=0; i<36; i++) {
memcpy(B, A, size);
f1 = conversions[i][0]-PlasmaCM;
f2 = conversions[i][1]-PlasmaCM;
printf(" - TESTING ZGECFI (%4s => %4s) ...", formatstr[f1], formatstr[f2] );
ret = PLASMA_zgecfi(m, n, B, conversions[i][0], mb, nb, conversions[i][1], mb2, nb2);
if (ret != PLASMA_SUCCESS) {
printf("Failed\n");
continue;
}
if ( check_solution(m, n, mb, nb, mb2, nb2, A, B,
(int (*)(int, int, int, int, int, int))formatmap[f1],
(int (*)(int, int, int, int, int, int))formatmap[f2] ) == 0 )
printf("............ PASSED !\n");
else
printf("... FAILED !\n");
#if 0
{
char cmd[256];
sprintf(cmd, "mv $PWD/dot_dag_file.dot $PWD/zgecfi_%s_%s.dot", formatstr[f1], formatstr[f2]);
system(cmd);
}
#endif
}
free( A ); free( B );
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgeev ( int  argc,
char **  argv 
)
int testing_zgels ( int  argc,
char **  argv 
)

Definition at line 198 of file testing_zgels.c.

References blas_eps, check_factorization(), check_orthogonality(), check_solution(), IONE, ISEED, min, PLASMA_Alloc_Workspace_zgels(), PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_TREE_HOUSEHOLDER, PLASMA_zgelqf(), PLASMA_zgelqs(), PLASMA_zgels(), PLASMA_zgeqrf(), PLASMA_zgeqrs(), PLASMA_ztrsm(), PLASMA_zunglq(), PLASMA_zungqr(), PLASMA_zunmlq(), PLASMA_zunmqr(), PlasmaConjTrans, PlasmaLeft, PlasmaLower, PlasmaNonUnit, PlasmaNoTrans, PlasmaUpper, Q, T, and USAGE.

{
int mode = 0;
if ( argc < 1 ){
goto usage;
} else {
mode = atoi(argv[0]);
}
/* Check for number of arguments*/
if ( ((mode == 0) && (argc != 6)) ||
((mode != 0) && (argc != 7)) ){
usage:
USAGE("GELS", "MODE M N LDA NRHS LDB [RH]",
" - MODE : 0: flat, 1: tree (RH needed)\n"
" - M : number of rows of the matrix A\n"
" - N : number of columns of the matrix A\n"
" - LDA : leading dimension of the matrix A\n"
" - NRHS : number of RHS\n"
" - LDB : leading dimension of the matrix B\n"
" - RH : Size of each subdomains\n");
return -1;
}
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int NRHS = atoi(argv[4]);
int LDB = atoi(argv[5]);
int rh;
int K = min(M, N);
double eps;
int info_ortho, info_solution, info_factorization;
int i,j;
int LDAxN = LDA*N;
int LDBxNRHS = LDB*NRHS;
PLASMA_Complex64_t *B1 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *B2 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)){
printf("Out of Memory \n ");
return -2;
}
if ( mode ) {
rh = atoi(argv[6]);
}
eps = BLAS_dfpinfo( blas_eps );
/*----------------------------------------------------------
* TESTING ZGELS
*/
/* Initialize A1 and A2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for (i = 0; i < M; i++)
for (j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i] ;
/* Initialize B1 and B2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for (i = 0; i < M; i++)
for (j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i] ;
memset((void*)Q, 0, LDA*N*sizeof(PLASMA_Complex64_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
/* PLASMA ZGELS */
PLASMA_zgels(PlasmaNoTrans, M, N, NRHS, A2, LDA, T, B2, LDB);
/* PLASMA ZGELS */
if (M >= N)
/* Building the economy-size Q */
PLASMA_zungqr(M, N, K, A2, LDA, T, Q, LDA);
else
/* Building the economy-size Q */
PLASMA_zunglq(M, N, K, A2, LDA, T, Q, LDA);
printf("\n");
printf("------ TESTS FOR PLASMA ZGELS ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the orthogonality, factorization and the solution */
info_ortho = check_orthogonality(M, N, LDA, Q, eps);
info_factorization = check_factorization(M, N, A1, A2, LDA, Q, eps);
info_solution = check_solution(M, N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)&(info_factorization == 0)&(info_ortho == 0)) {
printf("***************************************************\n");
printf(" ---- TESTING ZGELS ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZGELS ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING ZGEQRF + ZGEQRS or ZGELQF + ZGELQS
*/
/* Initialize A1 and A2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for (i = 0; i < M; i++)
for (j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
/* Initialize B1 and B2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for (i = 0; i < M; i++)
for (j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i];
memset((void*)Q, 0, LDA*N*sizeof(PLASMA_Complex64_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA ZGEQRF + ZGEQRS ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Plasma routines */
PLASMA_zgeqrf(M, N, A2, LDA, T);
PLASMA_zungqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_zgeqrs(M, N, NRHS, A2, LDA, T, B2, LDB);
/* Check the orthogonality, factorization and the solution */
info_ortho = check_orthogonality(M, N, LDA, Q, eps);
info_factorization = check_factorization(M, N, A1, A2, LDA, Q, eps);
info_solution = check_solution(M, N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)&(info_factorization == 0)&(info_ortho == 0)) {
printf("***************************************************\n");
printf(" ---- TESTING ZGEQRF + ZGEQRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING ZGEQRF + ZGEQRS ... FAILED !\n");
printf("***************************************************\n");
}
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA ZGELQF + ZGELQS ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Plasma routines */
PLASMA_zgelqf(M, N, A2, LDA, T);
PLASMA_zunglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_zgelqs(M, N, NRHS, A2, LDA, T, B2, LDB);
/* Check the orthogonality, factorization and the solution */
info_ortho = check_orthogonality(M, N, LDA, Q, eps);
info_factorization = check_factorization(M, N, A1, A2, LDA, Q, eps);
info_solution = check_solution(M, N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ( (info_solution == 0) & (info_factorization == 0) & (info_ortho == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZGELQF + ZGELQS ............ PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING ZGELQF + ZGELQS ... FAILED !\n");
printf("***************************************************\n");
}
}
/*----------------------------------------------------------
* TESTING ZGEQRF + ZORMQR + ZTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for (i = 0; i < M; i++)
for (j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
/* Initialize B1 and B2 */
memset(B2, 0, LDB*NRHS*sizeof(PLASMA_Complex64_t));
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for (i = 0; i < M; i++)
for (j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i];
/* PLASMA ZGEQRF+ ZUNMQR + ZTRSM */
memset((void*)Q, 0, LDA*N*sizeof(PLASMA_Complex64_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA ZGEQRF + ZUNMQR + ZTRSM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
PLASMA_zgeqrf(M, N, A2, LDA, T);
PLASMA_zungqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_zunmqr(PlasmaLeft, PlasmaConjTrans, M, NRHS, N, A2, LDA, T, B2, LDB);
PLASMA_ztrsm(PlasmaLeft, PlasmaUpper, PlasmaNoTrans, PlasmaNonUnit, N, NRHS, 1.0, A2, LDA, B2, LDB);
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA ZGELQF + ZUNMLQ + ZTRSM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
PLASMA_zgelqf(M, N, A2, LDA, T);
PLASMA_ztrsm(PlasmaLeft, PlasmaLower, PlasmaNoTrans, PlasmaNonUnit, M, NRHS, 1.0, A2, LDA, B2, LDB);
PLASMA_zunglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_zunmlq(PlasmaLeft, PlasmaConjTrans, N, NRHS, M, A2, LDA, T, B2, LDB);
}
/* Check the orthogonality, factorization and the solution */
info_ortho = check_orthogonality(M, N, LDA, Q, eps);
info_factorization = check_factorization(M, N, A1, A2, LDA, Q, eps);
info_solution = check_solution(M, N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ( (info_solution == 0) & (info_factorization == 0) & (info_ortho == 0) ) {
if (M >= N) {
printf("***************************************************\n");
printf(" ---- TESTING ZGEQRF + ZUNMQR + ZTRSM .... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING ZGELQF + ZTRSM + ZUNMLQ .... PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("***************************************************\n");
printf(" - TESTING ZGEQRF + ZUNMQR + ZTRSM ... FAILED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING ZGELQF + ZTRSM + ZUNMLQ ... FAILED !\n");
printf("***************************************************\n");
}
}
free(A1); free(A2); free(B1); free(B2); free(Q); free(T);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgemm ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_zgemm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_zgemm(), trans, transstr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 8) {
USAGE("GEMM", "alpha beta M N K LDA LDB LDC",
" - alpha : alpha coefficient\n"
" - beta : beta coefficient\n"
" - M : number of rows of matrices A and C\n"
" - N : number of columns of matrices B and C\n"
" - K : number of columns of matrix A / number of rows of matrix B\n"
" - LDA : leading dimension of matrix A\n"
" - LDB : leading dimension of matrix B\n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
PLASMA_Complex64_t beta = (PLASMA_Complex64_t) atol(argv[1]);
int M = atoi(argv[2]);
int N = atoi(argv[3]);
int K = atoi(argv[4]);
int LDA = atoi(argv[5]);
int LDB = atoi(argv[6]);
int LDC = atoi(argv[7]);
double eps;
int info_solution;
int i, j, ta, tb;
int LDAxK = LDA*max(M,K);
int LDBxN = LDB*max(K,N);
int LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZGEMM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZGEMM
*/
/* Initialize A, B, C */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
LAPACKE_zlarnv_work(IONE, ISEED, LDCxN, C);
#ifdef COMPLEX
for (ta=0; ta<3; ta++) {
for (tb=0; tb<3; tb++) {
#else
for (ta=0; ta<2; ta++) {
for (tb=0; tb<2; tb++) {
#endif
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cinit[LDC*j+i] = C[LDC*j+i];
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cfinal[LDC*j+i] = C[LDC*j+i];
/* PLASMA ZGEMM */
PLASMA_zgemm(trans[ta], trans[tb], M, N, K, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(trans[ta], trans[tb], M, N, K,
alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZGEMM (%s, %s) ............... PASSED !\n", transstr[ta], transstr[tb]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZGEMM (%s, %s) ... FAILED !\n", transstr[ta], transstr[tb]);
printf("************************************************\n");
}
}
}
#ifdef _UNUSED_
}}
#endif
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgesv ( int  argc,
char **  argv 
)

Definition at line 155 of file testing_zgesv.c.

References blas_eps, check_solution(), IONE, IPIV, ISEED, PLASMA_zgesv(), PLASMA_zgetrf(), PLASMA_zgetrs, PLASMA_zlaswp(), PLASMA_ztrsm(), PlasmaLeft, PlasmaLower, PlasmaNonUnit, PlasmaNoTrans, PlasmaUnit, PlasmaUpper, and USAGE.

{
/* Check for valid arguments*/
if (argc != 4){
USAGE("GESV", "N LDA NRHS LDB",
" - N : the size of the matrix\n"
" - LDA : leading dimension of the matrix A\n"
" - NRHS : number of RHS\n"
" - LDB : leading dimension of the matrix B\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int NRHS = atoi(argv[2]);
int LDB = atoi(argv[3]);
double eps;
int info_solution;
int i,j;
int LDAxN = LDA*N;
int LDBxNRHS = LDB*NRHS;
PLASMA_Complex64_t *A1 = (PLASMA_Complex64_t *)malloc(LDA*N *sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *A2 = (PLASMA_Complex64_t *)malloc(LDA*N *sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *B1 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *B2 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
int *IPIV = (int *)malloc(N*sizeof(int));
/* Check if unable to allocate memory */
if ( (!A1) || (!A2)|| (!B1) || (!B2) || (!IPIV) ) {
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_dfpinfo(blas_eps);
/*----------------------------------------------------------
* TESTING ZGESV
*/
/* Initialize A1 and A2 Matrix */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for ( i = 0; i < N; i++)
for ( j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
/* Initialize B1 and B2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for ( i = 0; i < N; i++)
for ( j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i];
/* PLASMA ZGESV */
PLASMA_zgesv(N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZGESV ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the factorization and the solution */
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)){
printf("***************************************************\n");
printf(" ---- TESTING ZGESV ...................... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("************************************************\n");
printf(" - TESTING ZGESV ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING ZGETRF + ZGETRS
*/
/* Initialize A1 and A2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for ( i = 0; i < N; i++)
for ( j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
/* Initialize B1 and B2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for ( i = 0; i < N; i++)
for ( j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i];
/* Plasma routines */
PLASMA_zgetrf(N, N, A2, LDA, IPIV);
PLASMA_zgetrs(PlasmaNoTrans, N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZGETRF + ZGETRS ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the solution */
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)){
printf("***************************************************\n");
printf(" ---- TESTING ZGETRF + ZGETRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING ZGETRF + ZGETRS ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING ZGETRF + ZTRSMPL + ZTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A1);
for ( i = 0; i < N; i++)
for ( j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
/* Initialize B1 and B2 */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxNRHS, B1);
for ( i = 0; i < N; i++)
for ( j = 0; j < NRHS; j++)
B2[LDB*j+i] = B1[LDB*j+i];
/* PLASMA routines */
PLASMA_zgetrf(N, N, A2, LDA, IPIV);
PLASMA_zlaswp(NRHS, B2, LDB, 1, N, IPIV, 1);
N, NRHS, 1.0, A2, LDA, B2, LDB);
N, NRHS, 1.0, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZGETRF + ZLASWP + ZTRSM + ZTRSM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the solution */
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)){
printf("***************************************************\n");
printf(" ---- TESTING ZGETRF + ZLASWP + ZTRSM + ZTRSM ... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("**************************************************\n");
printf(" - TESTING ZGETRF + ZLASWP + ZTRSM + ZTRSM ... FAILED !\n");
printf("**************************************************\n");
}
free(A1); free(A2); free(B1); free(B2); free(IPIV);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgesvd ( int  argc,
char **  argv 
)

Definition at line 33 of file testing_zgesvd.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, max, min, PLASMA_Alloc_Workspace_zgesvd(), PLASMA_Dealloc_Handle_Tile(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_TREE_HOUSEHOLDER, PLASMA_WARNINGS, PLASMA_zgesvd(), PlasmaDistUniform, PlasmaLeft, PlasmaNonsymPosv, PlasmaNoPacking, PlasmaNoVec, PlasmaRight, PlasmaVec, T, and USAGE.

{
int tree = 0;
if ( argc < 1 ){
goto usage;
} else {
tree = atoi(argv[0]);
}
/* Check for number of arguments*/
if ( ((tree == 0) && (argc != 4)) ||
((tree != 0) && (argc != 5)) ){
usage:
USAGE("GESVD", "MODE M N LDA [RH]",
" - MODE : 0: flat, 1: tree (RH needed)\n"
" - M : number of rows of the matrix A\n"
" - N : number of columns of the matrix A\n"
" - LDA : leading dimension of the matrix A\n"
" - RH : Size of each subdomains\n");
return -1;
}
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int rh;
if ( tree ) {
rh = atoi(argv[4]);
}
if (LDA < M){
printf("LDA should be >= M !\n");
return -1;
}
double eps = LAPACKE_dlamch_work('e');
double dmax = 1.0;
int info_orthou = 0;
int info_orthovt = 0;
int info_solution = 0;
int info_reduction = 0;
int minMN = min(M, N);
int mode = 4;
double rcond = (double) minMN;
double *S1 = (double *) malloc(minMN*sizeof(double));
double *S2 = (double *) malloc(minMN*sizeof(double));
PLASMA_Complex64_t *work = (PLASMA_Complex64_t *)malloc(3*max(M, N)* sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *A2 = NULL;
PLASMA_Complex64_t *U = NULL;
PLASMA_Complex64_t *VT = NULL;
/* Check if unable to allocate memory */
if ( (!A1) || (!S1) || (!S2) || (!work) ) {
printf("Out of Memory \n ");
return -2;
}
/*
PLASMA_Disable(PLASMA_AUTOTUNING);
PLASMA_Set(PLASMA_TILE_SIZE, 120);
PLASMA_Set(PLASMA_INNER_BLOCK_SIZE, 40);
*/
/*----------------------------------------------------------
* TESTING ZGESVD
*/
/* Initialize A1 */
LAPACKE_zlatms_work( LAPACK_COL_MAJOR, M, N,
lapack_const(PlasmaNonsymPosv), S1, mode, rcond,
dmax, M, N,
lapack_const(PlasmaNoPacking), A1, LDA, work );
free(work);
/* Copy A1 for check */
if ( (vecu == PlasmaVec) && (vecvt == PlasmaVec) ) {
A2 = (PLASMA_Complex64_t *)malloc(LDA*N*sizeof(PLASMA_Complex64_t));
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', M, N, A1, LDA, A2, LDA);
}
if ( vecu == PlasmaVec ) {
U = (PLASMA_Complex64_t *)malloc(M*M*sizeof(PLASMA_Complex64_t));
LAPACKE_zlaset_work(LAPACK_COL_MAJOR, 'A', M, M, 0., 1., U, M);
}
if ( vecvt == PlasmaVec ) {
VT = (PLASMA_Complex64_t *)malloc(N*N*sizeof(PLASMA_Complex64_t));
LAPACKE_zlaset_work(LAPACK_COL_MAJOR, 'A', N, N, 0., 1., VT, N);
}
/* PLASMA ZGESVD */
PLASMA_zgesvd(vecu, vecvt, M, N, A1, LDA, S2, U, M, VT, N, T);
if (getenv("PLASMA_TESTING_VERBOSE"))
{
int i;
printf("Eigenvalues original\n");
for (i = 0; i < min(N,25); i++){
printf("%f ", S1[i]);
}
printf("\n");
printf("Eigenvalues computed\n");
for (i = 0; i < min(N,25); i++){
printf("%f ", S2[i]);
}
printf("\n");
}
printf("\n");
printf("------ TESTS FOR PLASMA ZGESVD ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the orthogonality, reduction and the singular values */
if ( vecu == PlasmaVec )
info_orthou = check_orthogonality(PlasmaLeft, M, M, U, M, eps);
if ( vecvt == PlasmaVec )
info_orthovt = check_orthogonality(PlasmaRight, N, N, VT, N, eps);
/*
* WARNING: For now, Q is associated to Band tridiagonal reduction and
* not to the final tridiagonal reduction, so we can not call the check
* Need to accumulate the orthogonal transformations
* during the bulge chasing to be able to perform the next test!
*/
if ( (vecu == PlasmaVec) && (vecvt == PlasmaVec) && 0 )
info_reduction = check_reduction(M, N, A2, A1, LDA, U, M, VT, N, eps);
info_solution = check_solution(minMN, S1, S2, eps);
if ( (info_solution == 0) & (info_orthou == 0) &
(info_orthovt == 0) & (info_reduction == 0) ) {
if (M >= N) {
printf("***************************************************\n");
printf(" ---- TESTING ZGESVD .. M >= N ........... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING ZGESVD .. M < N ............ PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("************************************************\n");
printf(" - TESTING ZGESVD .. M >= N .. FAILED !\n");
printf("************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZGESVD .. M < N .. FAILED !\n");
printf("************************************************\n");
}
}
if ( A2 != NULL ) free(A2);
if ( U != NULL ) free(U);
if ( VT != NULL ) free(VT);
free(A1); free(S1); free(S2);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgetmi ( int  argc,
char **  argv 
)

Definition at line 46 of file testing_zgetmi.c.

References A, B, check_solution(), format, formatmap, formatstr, ISEED, PLASMA_SUCCESS, PLASMA_zgetmi(), and USAGE.

{
int m, n, mb, nb;
int i, ret, size;
/* Check for number of arguments*/
if (argc != 4){
USAGE("GETMI", "M N MB NB ntdbypb with \n",
" - M : the number of rows of the matrix \n"
" - N : the number of columns of the matrix \n"
" - MB : the number of rows of each block \n"
" - NB : the number of columns of each block \n");
return -1;
}
m = atoi(argv[0]);
n = atoi(argv[1]);
mb = atoi(argv[2]);
nb = atoi(argv[3]);
size = m*n*sizeof(PLASMA_Complex64_t);
A = (PLASMA_Complex64_t *)malloc(size);
B = (PLASMA_Complex64_t *)malloc(size);
LAPACKE_zlarnv_work(1, ISEED, m*n, A);
for(i=0; i<6; i++) {
memcpy(B, A, size);
printf(" - TESTING ZGETMI (%4s) ...", formatstr[i]);
ret = PLASMA_zgetmi( m, n, A, format[i], mb, nb );
if (ret != PLASMA_SUCCESS) {
printf("Failed\n");
continue;
}
if ( check_solution(m, n, mb, nb, B, A,
(int (*)(int, int, int, int, int, int))formatmap[i]) == 0 )
printf("............ PASSED !\n");
else
printf("... FAILED !\n");
}
free( A ); free( B );
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zgetri ( int  argc,
char **  argv 
)

Definition at line 29 of file testing_zgetri.c.

References check_factorization(), IPIV, PLASMA_zgetrf(), PLASMA_zgetri(), PLASMA_zplrnt(), and USAGE.

{
/* Check for number of arguments*/
if (argc != 2){
USAGE("GETRI", "N LDA",
" - N : the size of the matrix\n"
" - LDA : leading dimension of the matrix A\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
double eps;
int info_inverse, info_factorization;
int i, j;
PLASMA_Complex64_t *WORK = (PLASMA_Complex64_t *)malloc(2*LDA*sizeof(PLASMA_Complex64_t));
double *D = (double *)malloc(LDA*sizeof(double));
int *IPIV = (int *)malloc(N*sizeof(int));
/* Check if unable to allocate memory */
if ( (!A1) || (!A2) || (!IPIV) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
/*-------------------------------------------------------------
* TESTING ZGETRI
*/
/* Initialize A1 and A2 Matrix */
PLASMA_zplrnt(N, N, A1, LDA, 3453);
for ( i = 0; i < N; i++)
for ( j = 0; j < N; j++)
A2[LDA*j+i] = A1[LDA*j+i];
printf("\n");
printf("------ TESTS FOR PLASMA ZGETRI ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* PLASMA ZGETRF */
PLASMA_zgetrf(N, N, A2, LDA, IPIV);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, IPIV, eps);
/* PLASMA ZGETRI */
PLASMA_zgetri(N, A2, LDA, IPIV);
/* Check the inverse */
info_inverse = check_inverse(N, A1, A2, LDA, IPIV, eps);
if ( (info_inverse == 0) && (info_factorization == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZGETRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING ZGETRI ... FAILED !\n");
printf("***************************************************\n");
}
free(A1); free(A2); free(IPIV); free(WORK); free(D);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zheev ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_zheev.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, min, PLASMA_Alloc_Workspace_zheev(), PLASMA_Dealloc_Handle_Tile(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_WARNINGS, PLASMA_zheev(), PlasmaDistSymmetric, PlasmaHermGeev, PlasmaLower, PlasmaNoPacking, PlasmaNoVec, PlasmaVec, Q, T, uplo, and USAGE.

{
/* Check for number of arguments*/
if (argc != 2) {
USAGE("HEEV", "N LDA",
" - N : size of the matrix A\n"
" - LDA : leading dimension of the matrix A\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int LDQ = LDA;
int mode = 4;
double eps = LAPACKE_dlamch_work('e');
double dmax = 1.0;
double rcond = 1.0e6;
int info_ortho = 0;
int info_solution = 0;
int info_reduction = 0;
int i;
int LDAxN = LDA*N;
int LDQxN = LDQ*N;
PLASMA_Complex64_t *A1 = NULL;
double *W1 = (double *)malloc(N*sizeof(double));
double *W2 = (double *)malloc(N*sizeof(double));
PLASMA_Complex64_t *work = (PLASMA_Complex64_t *)malloc(3*N* sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A2) || (!W1) || (!W2) ){
printf("Out of Memory \n ");
return -2;
}
/*
PLASMA_Disable(PLASMA_AUTOTUNING);
PLASMA_Set(PLASMA_TILE_SIZE, 120);
PLASMA_Set(PLASMA_INNER_BLOCK_SIZE, 20);
*/
/*----------------------------------------------------------
* TESTING ZHEEV
*/
/* Initialize A1 */
LAPACKE_zlatms_work( LAPACK_COL_MAJOR, N, N,
lapack_const(PlasmaHermGeev), W1, mode, rcond,
dmax, N, N,
lapack_const(PlasmaNoPacking), A2, LDA, work );
/*
* Sort the eigenvalue because when computing the tridiag
* and then the eigenvalue of the DSTQR are sorted.
* So to avoid testing fail when having good results W1 should be sorted
*/
LAPACKE_dlasrt_work( 'I', N, W1 );
if (getenv("PLASMA_TESTING_VERBOSE"))
{
printf("Eigenvalues original\n");
for (i = 0; i < min(N,25); i++){
printf("%f \n", W1[i]);
}
printf("\n");
}
if ( vec == PlasmaVec ) {
Q = (PLASMA_Complex64_t *)malloc(LDQxN*sizeof(PLASMA_Complex64_t));
A1 = (PLASMA_Complex64_t *)malloc(LDAxN*sizeof(PLASMA_Complex64_t));
/* Copy A2 into A1 */
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A2, LDA, A1, LDA);
}
/* PLASMA ZHEEV */
PLASMA_zheev(vec, uplo, N, A2, LDA, W2, T, Q, LDQ);
if (getenv("PLASMA_TESTING_VERBOSE"))
{
printf("Eigenvalues computed\n");
for (i = 0; i < min(N,25); i++){
printf("%f \n", W2[i]);
}
printf("\n");
}
printf("\n");
printf("------ TESTS FOR PLASMA ZHEEV ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the orthogonality, reduction and the eigen solutions */
if (vec == PlasmaVec) {
info_ortho = check_orthogonality(N, N, Q, LDQ, eps);
/*
* WARNING: For now, Q is associated to Band tridiagonal reduction and
* not to the final tridiagonal reduction, so we can not call the check
*/
/*info_reduction = check_reduction(uplo, N, 1, A1, A2, LDA, Q, eps);*/
}
info_solution = check_solution(N, W1, W2, eps);
if ( (info_solution == 0) & (info_ortho == 0) & (info_reduction == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZHEEV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHEEV ... FAILED !\n");
printf("************************************************\n");
}
free(A2);
free(W1);
free(W2);
free(work);
if (Q != NULL) free(Q);
if (A1 != NULL) free(A1);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zhegst ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_zhegst.c.

References check_factorization(), itype, itypestr, PLASMA_zhegst(), PLASMA_zplghe(), PLASMA_zpotrf(), uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if (argc != 3) {
USAGE("HEGST", "N LDA LDB",
" - N : size of the matrices A and B\n"
" - LDA : leading dimension of the matrix A\n"
" - LDB : leading dimension of the matrix B\n");
return -1;
}
double eps = LAPACKE_dlamch_work('e');
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int LDB = atoi(argv[2]);
int info_transformation, info_factorization;
int i, u;
int LDAxN = LDA*N;
int LDBxN = LDB*N;
PLASMA_Complex64_t *Ainit = (PLASMA_Complex64_t *)malloc(LDAxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Binit = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Ainit)||(!Binit)){
printf("Out of Memory \n ");
return -2;
}
/*----------------------------------------------------------
* TESTING ZHEGST
*/
/* Initialize A1 and A2 */
PLASMA_zplghe(0., N, A1, LDA, 5198);
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and B2 */
PLASMA_zplghe((double)N, N, B1, LDB, 4231);
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZHEGST ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrices A and B are randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/*----------------------------------------------------------
* TESTING ZHEGST
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
memcpy(A2, Ainit, LDAxN*sizeof(PLASMA_Complex64_t));
memcpy(B2, Binit, LDBxN*sizeof(PLASMA_Complex64_t));
PLASMA_zpotrf(uplo[u], N, B2, LDB);
PLASMA_zhegst(itype[i], uplo[u], N, A2, LDA, B2, LDB);
/* Check the Cholesky factorization and the transformation */
info_factorization = check_factorization(N, B1, B2, LDB, uplo[u], eps);
info_transformation = check_transformation(itype[i], uplo[u], N, A1, A2, LDA, B2, LDB, eps);
if ( (info_transformation == 0) && (info_factorization == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZHEGST (%s, %s) ....... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHEGST (%s, %s) ... FAILED !\n", itypestr[i], uplostr[u]);
printf("************************************************\n");
}
}
}
free(A1);
free(A2);
free(B1);
free(B2);
free(Ainit);
free(Binit);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zhegv ( int  argc,
char **  argv 
)

Definition at line 36 of file testing_zhegv.c.

References check_orthogonality(), check_solution(), itype, itypestr, lapack_const, PLASMA_Alloc_Workspace_zhegv(), PLASMA_Dealloc_Handle_Tile(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_WARNINGS, PLASMA_zhegv(), PLASMA_zplghe(), PlasmaNoVec, PlasmaVec, Q, T, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if (argc != 3) {
USAGE("HEGV", "N LDA LDB",
" - N : size of the matrices A and B\n"
" - LDA : leading dimension of the matrix A\n"
" - LDB : leading dimension of the matrix B\n");
return -1;
}
double eps = LAPACKE_dlamch_work('e');
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int LDB = atoi(argv[2]);
int LDQ = LDA;
int LDAxN = LDA*N;
int LDBxN = LDB*N;
int LDQxN = LDQ*N;
int info_ortho = 0;
int info_solution = 0;
int info_reduction = 0;
int i, u;
PLASMA_Complex64_t *Ainit = (PLASMA_Complex64_t *)malloc(LDAxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Binit = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
double *W1 = (double *)malloc(N*sizeof(double));
double *W2 = (double *)malloc(N*sizeof(double));
PLASMA_Complex64_t *work = (PLASMA_Complex64_t *)malloc(3*N* sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Q)||(!Ainit)||(!Binit)){
printf("Out of Memory \n ");
return -2;
}
/*
PLASMA_Disable(PLASMA_AUTOTUNING);
PLASMA_Set(PLASMA_TILE_SIZE, 120);
PLASMA_Set(PLASMA_INNER_BLOCK_SIZE, 20);
*/
/*----------------------------------------------------------
* TESTING ZHEGV
*/
/* Initialize A1 and Ainit */
PLASMA_zplghe(0., N, A1, LDA, 5198);
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and Binit */
PLASMA_zplghe((double)N, N, B1, LDB, 4321 );
LAPACKE_zlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZHEGV ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/*----------------------------------------------------------
* TESTING ZHEGV
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
LAPACKE_zlaset_work(LAPACK_COL_MAJOR, 'A', LDA, N, 0., 1., Q, LDA);
memcpy(A2, Ainit, LDAxN*sizeof(PLASMA_Complex64_t));
memcpy(B2, Binit, LDBxN*sizeof(PLASMA_Complex64_t));
PLASMA_zhegv(itype[i], vec, uplo[u], N, A2, LDA, B2, LDB, W2, T, Q, LDQ);
/* Check the orthogonality, reduction and the eigen solutions */
if (vec == PlasmaVec)
info_ortho = check_orthogonality(N, N, Q, LDA, eps);
/*
* WARNING: For now, Q is associated to Band tridiagonal reduction and
* not to the final tridiagonal reduction, so we can not call the check
*/
if (0)
info_reduction = check_reduction(itype[i], uplo[u], N, 1, A1, A2, LDA, B2, LDB, Q, eps);
memcpy(A1, Ainit, LDAxN*sizeof(PLASMA_Complex64_t));
memcpy(B1, Binit, LDBxN*sizeof(PLASMA_Complex64_t));
LAPACKE_zhegv( LAPACK_COL_MAJOR,
N, A1, LDA, B1, LDB, W1);
/*info_solution = check_solution(N, N, N, A1, LDA, B1, B2, LDB, eps);*/
info_solution = check_solution(N, W1, W2, eps);
if ( (info_ortho == 0) & (info_reduction == 0) & (info_solution == 0)) {
printf("***************************************************\n");
printf(" ---- TESTING ZHEGV (%s, %s) ...................... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHEGV (%s, %s) ... FAILED !\n", itypestr[i], uplostr[u]);
printf("************************************************\n");
}
}
}
free(A1);
free(A2);
free(B1);
free(B2);
free(Q);
free(Ainit);
free(Binit);
free(W1);
free(W2);
free(work);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zhemm ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_zhemm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_zhemm(), PLASMA_zplghe(), side, sidestr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 7 ){
USAGE("HEMM", "alpha beta M N K LDA LDB LDC",
" - alpha : alpha coefficient \n"
" - beta : beta coefficient \n"
" - M : number of rows of matrices A and C \n"
" - N : number of columns of matrices B and C \n"
" - LDA : leading dimension of matrix A \n"
" - LDB : leading dimension of matrix B \n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
PLASMA_Complex64_t beta = (PLASMA_Complex64_t) atol(argv[1]);
int M = atoi(argv[2]);
int N = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDB = atoi(argv[5]);
int LDC = atoi(argv[6]);
int MNmax = max(M, N);
double eps;
int info_solution;
int i, j, s, u;
int LDAxM = LDA*MNmax;
int LDBxN = LDB*N;
int LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZHEMM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZHEMM
*/
/* Initialize A */
PLASMA_zplghe( (double)0., MNmax, A, LDA, 51 );
/* Initialize B */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
/* Initialize C */
LAPACKE_zlarnv_work(IONE, ISEED, LDCxN, C);
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
/* Initialize Cinit / Cfinal */
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cinit[LDC*j+i] = C[LDC*j+i];
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cfinal[LDC*j+i] = C[LDC*j+i];
/* PLASMA ZHEMM */
PLASMA_zhemm(side[s], uplo[u], M, N, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(side[s], uplo[u], M, N, alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZHEMM (%5s, %5s) ....... PASSED !\n", sidestr[s], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHEMM (%s, %s) ... FAILED !\n", sidestr[s], uplostr[u]);
printf("************************************************\n");
}
}
}
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zher2k ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_zher2k.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_zher2k(), PLASMA_zplghe(), PlasmaTrans, trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 7 ){
USAGE("HER2K", "alpha beta M N LDA LDB LDC",
" - alpha : alpha coefficient\n"
" - beta : beta coefficient\n"
" - N : number of columns and rows of matrix C and number of row of matrix A and B\n"
" - K : number of columns of matrix A and B\n"
" - LDA : leading dimension of matrix A\n"
" - LDB : leading dimension of matrix B\n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
double beta = (double) atol(argv[1]);
int N = atoi(argv[2]);
int K = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDB = atoi(argv[5]);
int LDC = atoi(argv[6]);
int NKmax = max(N, K);
double eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDBxK = LDB*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZHER2K ROUTINE ------- \n");
printf(" Size of the Matrix C %d by %d\n", N, K);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZHER2K
*/
/* Initialize A,B */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxK, B);
/* Initialize C */
PLASMA_zplghe( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<3; t++) {
if (trans[t] == PlasmaTrans) continue;
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZHER2K */
PLASMA_zher2k(uplo[u], trans[t], N, K, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZHER2K (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHER2K (%5s, %s) ... FAILED !\n", uplostr[u], transstr[t]);
printf("************************************************\n");
}
}
}
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zherk ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_zherk.c.

References A, C, check_solution(), IONE, ISEED, max, PLASMA_zherk(), PLASMA_zplgsy(), PlasmaTrans, trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 6 ){
USAGE("HERK", "alpha beta M N LDA LDC",
" - alpha : alpha coefficient\n"
" - beta : beta coefficient\n"
" - N : number of columns and rows of matrix C and number of row of matrix A\n"
" - K : number of columns of matrix A\n"
" - LDA : leading dimension of matrix A\n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
double alpha = (double) atol(argv[0]);
double beta = (double) atol(argv[1]);
int N = atoi(argv[2]);
int K = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDC = atoi(argv[5]);
int NKmax = max(N, K);
double eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZHERK ROUTINE ------- \n");
printf(" Size of the Matrix A %d by %d\n", N, K);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZHERK
*/
/* Initialize A */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxK, A);
/* Initialize C */
PLASMA_zplgsy( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<3; t++) {
if (trans[t] == PlasmaTrans) continue;
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZHERK */
PLASMA_zherk(uplo[u], trans[t], N, K, alpha, A, LDA, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZHERK (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZHERK (%5s, %s) ... FAILED !\n", uplostr[u], transstr[t]);
printf("************************************************\n");
}
}
}
free(A); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zlange ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_zlange.c.

References A, cimag(), IONE, ISEED, lapack_const, max, min, norm, normstr, PLASMA_zlange, PLASMA_zlanhe, PLASMA_zlansy(), uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 3) {
USAGE("LANGE", "M N LDA",
" - M : number of rows of matrices A and C\n"
" - N : number of columns of matrices B and C\n"
" - LDA : leading dimension of matrix A\n");
return -1;
}
int M = atoi(argv[0]);
int N = atoi(argv[1]);
int LDA = atoi(argv[2]);
int LDAxN = LDA*N;
int n, u;
double eps;
double *work = (double*) malloc(max(M,N)*sizeof(double));
double normplasma, normlapack;
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZLANGE ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZLANGE
*/
/* Initialize A, B, C */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxN, A);
/* PLASMA ZLANGE */
for(n=0; n<3; n++) {
normplasma = PLASMA_zlange(norm[n], M, N, A, LDA, work);
normlapack = LAPACKE_zlange_work(LAPACK_COL_MAJOR, lapack_const(norm[n]), M, N, A, LDA, work);
printf("Lapack %e, Plasma %e\n", normlapack, normplasma);
printf("***************************************************\n");
if ( abs(normlapack-normplasma) < eps ) {
printf(" ---- TESTING ZLANGE (%s)............... PASSED !\n", normstr[n]);
}
else {
printf(" - TESTING ZLANGE (%s)... FAILED !\n", normstr[n]);
}
printf("***************************************************\n");
}
/* PLASMA ZLANSY */
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_zlansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_zlansy_work(LAPACK_COL_MAJOR, lapack_const(norm[n]), lapack_const(uplo[u]), min(M,N), A, LDA, work);
printf("Lapack %e, Plasma %e\n", normlapack, normplasma);
printf("***************************************************\n");
if ( abs(normlapack-normplasma) < eps ) {
printf(" ---- TESTING ZLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING ZLANSY (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
}
#ifdef COMPLEX
/* PLASMA ZLANHE */
{
int j;
for (j=0; j<min(M,N); j++) {
A[j*LDA+j] -= I*cimag(A[j*LDA+j]);
}
}
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_zlanhe(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_zlanhe_work(LAPACK_COL_MAJOR, lapack_const(norm[n]), lapack_const(uplo[u]), min(M,N), A, LDA, work);
printf("Lapack %e, Plasma %e\n", normlapack, normplasma);
printf("***************************************************\n");
if ( abs(normlapack-normplasma) < eps ) {
printf(" ---- TESTING ZLANHE (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING ZLANHE (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
}
#endif
free(A); free(work);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zpemv ( int  argc,
char **  argv 
)

Definition at line 79 of file testing_zpemv.c.

References A, cblas_zcopy(), check_solution(), CORE_zpemv(), creal(), ISEED, PLASMA_zplrnt(), PlasmaColumnwise, PlasmaNoTrans, PlasmaRowwise, storev, storevstr, trans, transstr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 1) {
USAGE("PEMV", "N",
" - N : number of columns\n");
return -1;
}
/* Args */
int arg_n = atoi(argv[0]);
/* Local variables */
PLASMA_Complex64_t *A, *X, *Y, *A0, *Y0, *work;
PLASMA_Complex64_t alpha, beta, alpha0, beta0;
int n = arg_n;
int lda = arg_n;
int info_solution = 0;
int i, j, k, t;
int nbtests = 0;
int nfails = 0;
int m, l, storev, incx, incy;
char *cstorev;
double rnorm;
double eps = LAPACKE_dlamch_work('e');
/* Allocate Data */
A = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
A0 = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
X = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
Y = (PLASMA_Complex64_t *)malloc(lda*n*sizeof(PLASMA_Complex64_t));
Y0 = (PLASMA_Complex64_t *)malloc( n*sizeof(PLASMA_Complex64_t));
work = (PLASMA_Complex64_t *)malloc( 2*n*sizeof(PLASMA_Complex64_t));
LAPACKE_zlarnv_work(1, ISEED, 1, &alpha0);
LAPACKE_zlarnv_work(1, ISEED, 1, &beta0 );
/* Check if unable to allocate memory */
if ( (!A) || (!X) || (!Y0) || (!work) ) {
printf("Out of Memory \n ");
exit(0);
}
/* Initialize Data */
PLASMA_zplrnt(n, n, A, lda, 479 );
PLASMA_zplrnt(n, n, X, lda, 320 );
PLASMA_zplrnt(n, 1, Y0, n, 573 );
printf("\n");
printf("------ TESTS FOR PLASMA ZPEMV ROUTINE ------- \n");
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf(" The relative machine precision (eps) is %e \n",eps);
printf(" Computational tests pass if scaled residual is less than eps.\n");
printf("\n");
nfails = 0;
for (i=0; i<6; i++) {
/* m and n cannot be greater than lda (arg_n) */
switch (i) {
case 0: l = 0; m = arg_n; n = m; break;
case 1: l = 0; m = arg_n; n = arg_n/2; break;
case 2: l = arg_n; m = l; n = l; break;
case 3: l = arg_n/2; m = l; n = arg_n; break;
case 4: l = arg_n/2; m = arg_n-l; n = l; break;
case 5: l = arg_n/3; m = arg_n-l; n = arg_n/2; break;
}
/* Colwise ConjTrans & Rowwise NoTrans */
#ifdef COMPLEX
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
#endif
/* Swap m and n for transpose cases */
if ( t == 1 ) {
k = m; m = n; n = k;
}
LAPACKE_zlacpy_work( LAPACK_COL_MAJOR, 'A', m, n,
A, lda, A0, lda);
if ( trans[t] == PlasmaNoTrans ) {
storev = PlasmaRowwise;
cstorev = storevstr[0];
/* zeroed the upper right triangle */
int64_t i, j;
for (j=(n-l); j<n; j++) {
for (i=0; i<(j-(n-l)); i++) {
A0[i+j*lda] = 0.0;
}
}
}
else {
storev = PlasmaColumnwise;
cstorev = storevstr[1];
/* zeroed the lower left triangle */
int64_t i, j;
for (j=0; j<(l-1); j++) {
for (i=(m-l+1+j); i<m; i++) {
A0[i+j*lda] = 0.0;
}
}
}
for (j=0; j<3; j++) {
/* Choose alpha and beta */
alpha = ( j==1 ) ? 0.0 : alpha0;
beta = ( j==2 ) ? 0.0 : beta0;
/* incx and incy: 1 or lda */
for (k=0; k<4; k++) {
switch (k) {
case 0: incx = 1; incy = 1; break;
case 1: incx = 1; incy = lda; break;
case 2: incx = lda; incy = 1; break;
case 3: incx = lda; incy = lda; break;
}
/* initialize Y with incy */
cblas_zcopy(n, Y0, 1, Y, incy);
/* ZPEMV */
CORE_zpemv( trans[t], storev, m, n, l,
alpha, A, lda,
X, incx,
beta, Y, incy,
work);
/* Check the solution */
info_solution = check_solution(trans[t], storev,
m, n, l,
alpha, A0, lda,
X, incx,
beta, Y0, 1,
Y, incy,
work, &rnorm);
if ( info_solution != 0 ) {
nfails++;
printf("Failed: t=%s, s=%s, M=%3d, N=%3d, L=%3d, alpha=%e, incx=%3d, beta=%e, incy=%3d, rnorm=%e\n",
transstr[t], cstorev, m, n, l, creal(alpha), incx, creal(beta), incy, rnorm );
}
nbtests++;
}
}
}
}
if ( nfails )
printf("%d / %d tests failed\n", nfails, nbtests);
printf("***************************************************\n");
if (nfails == 0) {
printf(" ---- TESTING ZPEMV ...... PASSED !\n");
}
else {
printf(" ---- TESTING ZPEMV ... FAILED !\n");
}
printf("***************************************************\n");
free( A0 );
free( A );
free( X );
free( Y0 );
free( Y );
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zposv ( int  argc,
char **  argv 
)

Definition at line 154 of file testing_zposv.c.

References blas_eps, check_factorization(), check_solution(), PLASMA_zlacpy, PLASMA_zplghe(), PLASMA_zplrnt(), PLASMA_zposv(), PLASMA_zpotrf(), PLASMA_zpotrs(), PLASMA_ztrsm(), PlasmaConjTrans, PlasmaLeft, PlasmaNonUnit, PlasmaNoTrans, PlasmaUpper, PlasmaUpperLower, uplo, and USAGE.

{
/* Check for number of arguments*/
if (argc != 4){
USAGE("POSV", "N LDA NRHS LDB",
" - N : the size of the matrix\n"
" - LDA : leading dimension of the matrix A\n"
" - NRHS : number of RHS\n"
" - LDB : leading dimension of the RHS B\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
int NRHS = atoi(argv[2]);
int LDB = atoi(argv[3]);
double eps;
int uplo;
int info_solution, info_factorization;
int trans1, trans2;
PLASMA_Complex64_t *B1 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *B2 = (PLASMA_Complex64_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)){
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_dfpinfo( blas_eps );
uplo = PlasmaUpper;
/*-------------------------------------------------------------
* TESTING ZPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_zplghe( (double)N, N, A1, LDA, 51 );
PLASMA_zlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_zplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_zlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
printf("\n");
printf("------ TESTS FOR PLASMA ZPOSV ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* PLASMA ZPOSV */
PLASMA_zposv(uplo, N, NRHS, A2, LDA, B2, LDB);
/* Check the factorization and the solution */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ( (info_solution == 0) && (info_factorization == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZPOSV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING ZPOSV ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING ZPOTRF + ZPOTRS
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_zplghe( (double)N, N, A1, LDA, 51 );
PLASMA_zlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_zplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_zlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* Plasma routines */
PLASMA_zpotrf(uplo, N, A2, LDA);
PLASMA_zpotrs(uplo, N, NRHS, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZPOTRF + ZPOTRS ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the factorization and the solution */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)&(info_factorization == 0)){
printf("***************************************************\n");
printf(" ---- TESTING ZPOTRF + ZPOTRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("****************************************************\n");
printf(" - TESTING ZPOTRF + ZPOTRS ... FAILED !\n");
printf("****************************************************\n");
}
/*-------------------------------------------------------------
* TESTING ZPOTRF + ZPTRSM + ZTRSM
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_zplghe( (double)N, N, A1, LDA, 51 );
PLASMA_zlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_zplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_zlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* PLASMA routines */
PLASMA_zpotrf(uplo, N, A2, LDA);
N, NRHS, 1.0, A2, LDA, B2, LDB);
N, NRHS, 1.0, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA ZPOTRF + ZTRSM + ZTRSM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* Check the factorization and the solution */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
info_solution = check_solution(N, NRHS, A1, LDA, B1, B2, LDB, eps);
if ((info_solution == 0)&(info_factorization == 0)){
printf("***************************************************\n");
printf(" ---- TESTING ZPOTRF + ZTRSM + ZTRSM ..... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING ZPOTRF + ZTRSM + ZTRSM ... FAILED !\n");
printf("***************************************************\n");
}
free(A1); free(A2); free(B1); free(B2);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zpotri ( int  argc,
char **  argv 
)

Definition at line 164 of file testing_zpotri.c.

References blas_eps, check_factorization(), PLASMA_zlacpy, PLASMA_zplghe(), PLASMA_zpotrf(), PLASMA_zpotri(), PlasmaUpper, PlasmaUpperLower, uplo, and USAGE.

{
/* Check for number of arguments*/
if (argc != 2){
USAGE("POTRI", "N LDA",
" - N : the size of the matrix\n"
" - LDA : leading dimension of the matrix A\n");
return -1;
}
int N = atoi(argv[0]);
int LDA = atoi(argv[1]);
double eps;
int uplo;
int info_inverse, info_factorization;
PLASMA_Complex64_t *WORK = (PLASMA_Complex64_t *)malloc(2*LDA*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)){
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_dfpinfo( blas_eps );
uplo = PlasmaUpper;
/*-------------------------------------------------------------
* TESTING ZPOTRI
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_zplghe( (double)N, N, A1, LDA, 51 );
PLASMA_zlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
printf("\n");
printf("------ TESTS FOR PLASMA ZPOTRI ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", N, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n", eps);
printf(" Computational tests pass if scaled residuals are less than 60.\n");
/* PLASMA ZPOTRF */
PLASMA_zpotrf(uplo, N, A2, LDA);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
/* PLASMA ZPOTRI */
PLASMA_zpotri(uplo, N, A2, LDA);
/* Check the inverse */
info_inverse = check_inverse(N, A1, A2, LDA, uplo, eps);
if ( (info_inverse == 0) && (info_factorization == 0) ) {
printf("***************************************************\n");
printf(" ---- TESTING ZPOTRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING ZPOTRI ... FAILED !\n");
printf("***************************************************\n");
}
free(A1); free(A2); free(WORK);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zsymm ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_zsymm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_zplgsy(), PLASMA_zsymm(), side, sidestr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 7 ){
USAGE("SYMM", "alpha beta M N K LDA LDB LDC",
" - alpha : alpha coefficient \n"
" - beta : beta coefficient \n"
" - M : number of rows of matrices A and C \n"
" - N : number of columns of matrices B and C \n"
" - LDA : leading dimension of matrix A \n"
" - LDB : leading dimension of matrix B \n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
PLASMA_Complex64_t beta = (PLASMA_Complex64_t) atol(argv[1]);
int M = atoi(argv[2]);
int N = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDB = atoi(argv[5]);
int LDC = atoi(argv[6]);
int MNmax = max(M, N);
double eps;
int info_solution;
int i, j, s, u;
int LDAxM = LDA*MNmax;
int LDBxN = LDB*N;
int LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZSYMM ROUTINE ------- \n");
printf(" Size of the Matrix %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZSYMM
*/
/* Initialize A */
PLASMA_zplgsy( (double)0., MNmax, A, LDA, 51 );
/* Initialize B */
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
/* Initialize C */
LAPACKE_zlarnv_work(IONE, ISEED, LDCxN, C);
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
/* Initialize Cinit / Cfinal */
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cinit[LDC*j+i] = C[LDC*j+i];
for ( i = 0; i < M; i++)
for ( j = 0; j < N; j++)
Cfinal[LDC*j+i] = C[LDC*j+i];
/* PLASMA ZSYMM */
PLASMA_zsymm(side[s], uplo[u], M, N, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(side[s], uplo[u], M, N, alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZSYMM (%5s, %5s) ....... PASSED !\n", sidestr[s], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZSYMM (%s, %s) ... FAILED !\n", sidestr[s], uplostr[u]);
printf("************************************************\n");
}
}
}
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zsyr2k ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_zsyr2k.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_zplgsy(), PLASMA_zsyr2k(), trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 7 ){
USAGE("SYR2K", "alpha beta M N LDA LDB LDC",
" - alpha : alpha coefficient\n"
" - beta : beta coefficient\n"
" - N : number of columns and rows of matrix C and number of row of matrix A and B\n"
" - K : number of columns of matrix A and B\n"
" - LDA : leading dimension of matrix A\n"
" - LDB : leading dimension of matrix B\n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
PLASMA_Complex64_t beta = (PLASMA_Complex64_t) atol(argv[1]);
int N = atoi(argv[2]);
int K = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDB = atoi(argv[5]);
int LDC = atoi(argv[6]);
int NKmax = max(N, K);
double eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDBxK = LDB*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZSYR2K ROUTINE ------- \n");
printf(" Size of the Matrix C %d by %d\n", N, K);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZSYR2K
*/
/* Initialize A,B */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxK, B);
/* Initialize C */
PLASMA_zplgsy( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZSYR2K */
PLASMA_zsyr2k(uplo[u], trans[t], N, K, alpha, A, LDA, B, LDB, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, B, LDB, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZSYR2K (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZSYR2K (%5s, %s) ... FAILED !\n", uplostr[u], transstr[t]);
printf("************************************************\n");
}
}
}
free(A); free(B); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_zsyrk ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_zsyrk.c.

References A, C, check_solution(), IONE, ISEED, max, PLASMA_zplgsy(), PLASMA_zsyrk(), trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 6){
USAGE("SYRK", "alpha beta M N LDA LDC",
" - alpha : alpha coefficient\n"
" - beta : beta coefficient\n"
" - N : number of columns and rows of matrix C and number of row of matrix A\n"
" - K : number of columns of matrix A\n"
" - LDA : leading dimension of matrix A\n"
" - LDC : leading dimension of matrix C\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
PLASMA_Complex64_t beta = (PLASMA_Complex64_t) atol(argv[1]);
int N = atoi(argv[2]);
int K = atoi(argv[3]);
int LDA = atoi(argv[4]);
int LDC = atoi(argv[5]);
int NKmax = max(N, K);
double eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex64_t *Cinit = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Cfinal = (PLASMA_Complex64_t *)malloc(LDCxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZSYRK ROUTINE ------- \n");
printf(" Size of the Matrix A %d by %d\n", N, K);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZSYRK
*/
/* Initialize A */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxK, A);
/* Initialize C */
PLASMA_zplgsy( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex64_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZSYRK */
PLASMA_zsyrk(uplo[u], trans[t], N, K, alpha, A, LDA, beta, Cfinal, LDC);
/* Check the solution */
info_solution = check_solution(uplo[u], trans[t], N, K,
alpha, A, LDA, beta, Cinit, Cfinal, LDC);
if (info_solution == 0) {
printf("***************************************************\n");
printf(" ---- TESTING ZSYRK (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING ZSYRK (%5s, %s) ... FAILED !\n", uplostr[u], transstr[t]);
printf("************************************************\n");
}
}
}
free(A); free(C);
free(Cinit); free(Cfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_ztrmm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_ztrmm.c.

References A, B, CBLAS_SADDR, cblas_zaxpy(), cblas_ztrmm(), CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_ztrmm(), PlasmaInfNorm, PlasmaLeft, side, sidestr, trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 5 ) {
USAGE("TRMM", "alpha M N LDA LDB",
" - alpha : alpha coefficient\n"
" - M : number of rows of matrices B\n"
" - N : number of columns of matrices B\n"
" - LDA : leading dimension of matrix A\n"
" - LDB : leading dimension of matrix B\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int LDB = atoi(argv[4]);
double eps;
int info_solution;
int s, u, t, d, i;
int LDAxM = LDA*max(M,N);
int LDBxN = LDB*max(M,N);
PLASMA_Complex64_t *Binit = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Bfinal = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZTRMM ROUTINE ------- \n");
printf(" Size of the Matrix B : %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZTRMM
*/
/* Initialize A, B, C */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
for(i=0;i<max(M,N);i++)
A[LDA*i+i] = A[LDA*i+i] + 2.0;
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
#ifdef COMPLEX
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
#endif
for (d=0; d<2; d++) {
memcpy(Binit, B, LDBxN*sizeof(PLASMA_Complex64_t));
memcpy(Bfinal, B, LDBxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZTRMM */
PLASMA_ztrmm(side[s], uplo[u], trans[t], diag[d],
M, N, alpha, A, LDA, Bfinal, LDB);
/* Check the solution */
info_solution = check_solution(side[s], uplo[u], trans[t], diag[d],
M, N, alpha, A, LDA, Binit, Bfinal, LDB);
printf("***************************************************\n");
if (info_solution == 0) {
printf(" ---- TESTING ZTRMM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING ZTRMM (%s, %s, %s, %s) ... FAILED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
printf("***************************************************\n");
}
}
}
}
free(A); free(B);
free(Binit); free(Bfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int testing_ztrsm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_ztrsm.c.

References A, B, CBLAS_SADDR, cblas_zaxpy(), cblas_ztrsm(), CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_ztrsm(), PlasmaInfNorm, PlasmaLeft, side, sidestr, trans, transstr, uplo, uplostr, and USAGE.

{
/* Check for number of arguments*/
if ( argc != 5 ) {
USAGE("TRSM", "alpha M N LDA LDB",
" - alpha : alpha coefficient\n"
" - M : number of rows of matrices B\n"
" - N : number of columns of matrices B\n"
" - LDA : leading dimension of matrix A\n"
" - LDB : leading dimension of matrix B\n");
return -1;
}
PLASMA_Complex64_t alpha = (PLASMA_Complex64_t) atol(argv[0]);
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int LDB = atoi(argv[4]);
double eps;
int info_solution;
int s, u, t, d, i;
int LDAxM = LDA*max(M,N);
int LDBxN = LDB*max(M,N);
PLASMA_Complex64_t *Binit = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
PLASMA_Complex64_t *Bfinal = (PLASMA_Complex64_t *)malloc(LDBxN*sizeof(PLASMA_Complex64_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA ZTRSM ROUTINE ------- \n");
printf(" Size of the Matrix B : %d by %d\n", M, N);
printf("\n");
printf(" The matrix A is randomly generated for each test.\n");
printf("============\n");
printf(" The relative machine precision (eps) is to be %e \n",eps);
printf(" Computational tests pass if scaled residuals are less than 10.\n");
/*----------------------------------------------------------
* TESTING ZTRSM
*/
/* Initialize A, B, C */
LAPACKE_zlarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_zlarnv_work(IONE, ISEED, LDBxN, B);
for(i=0;i<max(M,N);i++)
A[LDA*i+i] = A[LDA*i+i] + 2.0;
for (s=0; s<2; s++) {
for (u=0; u<2; u++) {
#ifdef COMPLEX
for (t=0; t<3; t++) {
#else
for (t=0; t<2; t++) {
#endif
for (d=0; d<2; d++) {
memcpy(Binit, B, LDBxN*sizeof(PLASMA_Complex64_t));
memcpy(Bfinal, B, LDBxN*sizeof(PLASMA_Complex64_t));
/* PLASMA ZTRSM */
PLASMA_ztrsm(side[s], uplo[u], trans[t], diag[d],
M, N, alpha, A, LDA, Bfinal, LDB);
/* Check the solution */
info_solution = check_solution(side[s], uplo[u], trans[t], diag[d],
M, N, alpha, A, LDA, Binit, Bfinal, LDB);
printf("***************************************************\n");
if (info_solution == 0) {
printf(" ---- TESTING ZTRSM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING ZTRSM (%s, %s, %s, %s) ... FAILED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
printf("***************************************************\n");
}
}
}
}
free(A); free(B);
free(Binit); free(Bfinal);
return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int diag[2]

Definition at line 31 of file testing_cmain.c.

char* diagstr[2]

Definition at line 39 of file testing_cmain.c.

int format[6]

Definition at line 28 of file testing_cmain.c.

void* formatmap[6]

Definition at line 125 of file testing_cmain.c.

char* formatstr[6]

Definition at line 36 of file testing_cmain.c.

int IONE

Definition at line 37 of file example_cgelqf.c.

int ISEED[4]

Definition at line 38 of file example_cgelqf.c.

int itype[3]

Definition at line 33 of file testing_cmain.c.

char* itypestr[3]

Definition at line 41 of file testing_cmain.c.

int side[2]

Definition at line 29 of file testing_cmain.c.

char* sidestr[2]

Definition at line 37 of file testing_cmain.c.

int storev[2]

Definition at line 34 of file testing_cmain.c.

char* storevstr[2]

Definition at line 42 of file testing_cmain.c.

int trans[3]

Definition at line 32 of file testing_cmain.c.

char* transstr[3]

Definition at line 40 of file testing_cmain.c.

int uplo[2]

Definition at line 30 of file testing_cmain.c.

char* uplostr[2]

Definition at line 38 of file testing_cmain.c.