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_dmain.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_dgemm (int argc, char **argv)
int testing_dsymm (int argc, char **argv)
int testing_dsyrk (int argc, char **argv)
int testing_dsyr2k (int argc, char **argv)
int testing_dtrmm (int argc, char **argv)
int testing_dtrsm (int argc, char **argv)
int testing_dpemv (int argc, char **argv)
int testing_dposv (int argc, char **argv)
int testing_dgels (int argc, char **argv)
int testing_dgesv (int argc, char **argv)
int testing_dpotri (int argc, char **argv)
int testing_dgetri (int argc, char **argv)
int testing_dgeev (int argc, char **argv)
int testing_dgesvd (int argc, char **argv)
int testing_dsyev (int argc, char **argv)
int testing_dsygv (int argc, char **argv)
int testing_dsygst (int argc, char **argv)
int testing_dgecfi (int argc, char **argv)
int testing_dgetmi (int argc, char **argv)
int testing_dlange (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 d Tue Nov 22 14:35:50 2011

Definition in file testing_dmain.h.


Macro Definition Documentation

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

Definition at line 31 of file testing_dmain.h.

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

Definition at line 34 of file testing_dmain.h.

#define USAGE (   name,
  args,
  details 
)
Value:
printf(" Proper Usage is : ./dtesting 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_dmain.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_dgecfi ( int  argc,
char **  argv 
)

Definition at line 89 of file testing_dgecfi.c.

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

{
double *A, *B;
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(double);
A = (double *)malloc(size);
B = (double *)malloc(size);
LAPACKE_dlarnv_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 DGECFI (%4s => %4s) ...", formatstr[f1], formatstr[f2] );
ret = PLASMA_dgecfi(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/dgecfi_%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_dgeev ( int  argc,
char **  argv 
)
int testing_dgels ( int  argc,
char **  argv 
)

Definition at line 198 of file testing_dgels.c.

References blas_eps, check_factorization(), check_orthogonality(), check_solution(), IONE, ISEED, min, PLASMA_Alloc_Workspace_dgels(), PLASMA_dgelqf(), PLASMA_dgelqs(), PLASMA_dgels(), PLASMA_dgeqrf(), PLASMA_dgeqrs(), PLASMA_dorglq(), PLASMA_dorgqr(), PLASMA_dormlq(), PLASMA_dormqr(), PLASMA_dtrsm(), PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_TREE_HOUSEHOLDER, PlasmaLeft, PlasmaLower, PlasmaNonUnit, PlasmaNoTrans, PlasmaTrans, 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;
double *A1 = (double *)malloc(LDA*N*sizeof(double));
double *A2 = (double *)malloc(LDA*N*sizeof(double));
double *B1 = (double *)malloc(LDB*NRHS*sizeof(double));
double *B2 = (double *)malloc(LDB*NRHS*sizeof(double));
double *Q = (double *)malloc(LDA*N*sizeof(double));
double *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 DGELS
*/
/* Initialize A1 and A2 */
LAPACKE_dlarnv_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_dlarnv_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(double));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
/* PLASMA DGELS */
PLASMA_dgels(PlasmaNoTrans, M, N, NRHS, A2, LDA, T, B2, LDB);
/* PLASMA DGELS */
if (M >= N)
/* Building the economy-size Q */
PLASMA_dorgqr(M, N, K, A2, LDA, T, Q, LDA);
else
/* Building the economy-size Q */
PLASMA_dorglq(M, N, K, A2, LDA, T, Q, LDA);
printf("\n");
printf("------ TESTS FOR PLASMA DGELS 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 DGELS ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DGELS ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING DGEQRF + DGEQRS or DGELQF + DGELQS
*/
/* Initialize A1 and A2 */
LAPACKE_dlarnv_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_dlarnv_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(double));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA DGEQRF + DGEQRS 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_dgeqrf(M, N, A2, LDA, T);
PLASMA_dorgqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_dgeqrs(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 DGEQRF + DGEQRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING DGEQRF + DGEQRS ... FAILED !\n");
printf("***************************************************\n");
}
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA DGELQF + DGELQS 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_dgelqf(M, N, A2, LDA, T);
PLASMA_dorglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_dgelqs(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 DGELQF + DGELQS ............ PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING DGELQF + DGELQS ... FAILED !\n");
printf("***************************************************\n");
}
}
/*----------------------------------------------------------
* TESTING DGEQRF + ZORMQR + DTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_dlarnv_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(double));
LAPACKE_dlarnv_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 DGEQRF+ DORMQR + DTRSM */
memset((void*)Q, 0, LDA*N*sizeof(double));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA DGEQRF + DORMQR + DTRSM 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_dgeqrf(M, N, A2, LDA, T);
PLASMA_dorgqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_dormqr(PlasmaLeft, PlasmaTrans, M, NRHS, N, A2, LDA, T, B2, LDB);
PLASMA_dtrsm(PlasmaLeft, PlasmaUpper, PlasmaNoTrans, PlasmaNonUnit, N, NRHS, 1.0, A2, LDA, B2, LDB);
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA DGELQF + DORMLQ + DTRSM 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_dgelqf(M, N, A2, LDA, T);
PLASMA_dtrsm(PlasmaLeft, PlasmaLower, PlasmaNoTrans, PlasmaNonUnit, M, NRHS, 1.0, A2, LDA, B2, LDB);
PLASMA_dorglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_dormlq(PlasmaLeft, PlasmaTrans, 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 DGEQRF + DORMQR + DTRSM .... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING DGELQF + DTRSM + DORMLQ .... PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("***************************************************\n");
printf(" - TESTING DGEQRF + DORMQR + DTRSM ... FAILED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING DGELQF + DTRSM + DORMLQ ... 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_dgemm ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_dgemm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_dgemm(), 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;
}
double alpha = (double) atol(argv[0]);
double beta = (double) 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;
double *A = (double *)malloc(LDAxK*sizeof(double));
double *B = (double *)malloc(LDBxN*sizeof(double));
double *C = (double *)malloc(LDCxN*sizeof(double));
double *Cinit = (double *)malloc(LDCxN*sizeof(double));
double *Cfinal = (double *)malloc(LDCxN*sizeof(double));
/* 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 DGEMM 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 DGEMM
*/
/* Initialize A, B, C */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_dlarnv_work(IONE, ISEED, LDBxN, B);
LAPACKE_dlarnv_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 DGEMM */
PLASMA_dgemm(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 DGEMM (%s, %s) ............... PASSED !\n", transstr[ta], transstr[tb]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DGEMM (%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_dgesv ( int  argc,
char **  argv 
)

Definition at line 155 of file testing_dgesv.c.

References blas_eps, check_solution(), IONE, IPIV, ISEED, PLASMA_dgesv(), PLASMA_dgetrf(), PLASMA_dgetrs, PLASMA_dlaswp(), PLASMA_dtrsm(), 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;
double *A1 = (double *)malloc(LDA*N *sizeof(double));
double *A2 = (double *)malloc(LDA*N *sizeof(double));
double *B1 = (double *)malloc(LDB*NRHS*sizeof(double));
double *B2 = (double *)malloc(LDB*NRHS*sizeof(double));
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 DGESV
*/
/* Initialize A1 and A2 Matrix */
LAPACKE_dlarnv_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_dlarnv_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 DGESV */
PLASMA_dgesv(N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DGESV 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 DGESV ...................... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("************************************************\n");
printf(" - TESTING DGESV ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING DGETRF + DGETRS
*/
/* Initialize A1 and A2 */
LAPACKE_dlarnv_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_dlarnv_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_dgetrf(N, N, A2, LDA, IPIV);
PLASMA_dgetrs(PlasmaNoTrans, N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DGETRF + DGETRS 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 DGETRF + DGETRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING DGETRF + DGETRS ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING DGETRF + DTRSMPL + DTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_dlarnv_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_dlarnv_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_dgetrf(N, N, A2, LDA, IPIV);
PLASMA_dlaswp(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 DGETRF + DLASWP + DTRSM + DTRSM 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 DGETRF + DLASWP + DTRSM + DTRSM ... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("**************************************************\n");
printf(" - TESTING DGETRF + DLASWP + DTRSM + DTRSM ... 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_dgesvd ( int  argc,
char **  argv 
)

Definition at line 33 of file testing_dgesvd.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, max, min, PLASMA_Alloc_Workspace_dgesvd(), PLASMA_Dealloc_Handle_Tile(), PLASMA_dgesvd(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_TREE_HOUSEHOLDER, PLASMA_WARNINGS, 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 *A1 = (double *)malloc(LDA*N*sizeof(double));
double *S1 = (double *) malloc(minMN*sizeof(double));
double *S2 = (double *) malloc(minMN*sizeof(double));
double *work = (double *)malloc(3*max(M, N)* sizeof(double));
double *A2 = NULL;
double *U = NULL;
double *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 DGESVD
*/
/* Initialize A1 */
LAPACKE_dlatms_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 = (double *)malloc(LDA*N*sizeof(double));
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', M, N, A1, LDA, A2, LDA);
}
if ( vecu == PlasmaVec ) {
U = (double *)malloc(M*M*sizeof(double));
LAPACKE_dlaset_work(LAPACK_COL_MAJOR, 'A', M, M, 0., 1., U, M);
}
if ( vecvt == PlasmaVec ) {
VT = (double *)malloc(N*N*sizeof(double));
LAPACKE_dlaset_work(LAPACK_COL_MAJOR, 'A', N, N, 0., 1., VT, N);
}
/* PLASMA DGESVD */
PLASMA_dgesvd(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 DGESVD 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 DGESVD .. M >= N ........... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING DGESVD .. M < N ............ PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("************************************************\n");
printf(" - TESTING DGESVD .. M >= N .. FAILED !\n");
printf("************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DGESVD .. 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_dgetmi ( int  argc,
char **  argv 
)

Definition at line 46 of file testing_dgetmi.c.

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

{
double *A, *B;
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(double);
A = (double *)malloc(size);
B = (double *)malloc(size);
LAPACKE_dlarnv_work(1, ISEED, m*n, A);
for(i=0; i<6; i++) {
memcpy(B, A, size);
printf(" - TESTING DGETMI (%4s) ...", formatstr[i]);
ret = PLASMA_dgetmi( 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_dgetri ( int  argc,
char **  argv 
)

Definition at line 29 of file testing_dgetri.c.

References check_factorization(), IPIV, PLASMA_dgetrf(), PLASMA_dgetri(), PLASMA_dplrnt(), 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;
double *A1 = (double *)malloc(LDA*N*sizeof(double));
double *A2 = (double *)malloc(LDA*N*sizeof(double));
double *WORK = (double *)malloc(2*LDA*sizeof(double));
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 DGETRI
*/
/* Initialize A1 and A2 Matrix */
PLASMA_dplrnt(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 DGETRI 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 DGETRF */
PLASMA_dgetrf(N, N, A2, LDA, IPIV);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, IPIV, eps);
/* PLASMA DGETRI */
PLASMA_dgetri(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 DGETRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING DGETRI ... 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_dlange ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_dlange.c.

References A, cimag(), IONE, ISEED, lapack_const, max, min, norm, normstr, PLASMA_dlange, PLASMA_dlansy, 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 *A = (double *)malloc(LDAxN*sizeof(double));
double *work = (double*) malloc(max(M,N)*sizeof(double));
double normplasma, normlapack;
eps = LAPACKE_dlamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA DLANGE 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 DLANGE
*/
/* Initialize A, B, C */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxN, A);
/* PLASMA DLANGE */
for(n=0; n<3; n++) {
normplasma = PLASMA_dlange(norm[n], M, N, A, LDA, work);
normlapack = LAPACKE_dlange_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 DLANGE (%s)............... PASSED !\n", normstr[n]);
}
else {
printf(" - TESTING DLANGE (%s)... FAILED !\n", normstr[n]);
}
printf("***************************************************\n");
}
/* PLASMA DLANSY */
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_dlansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_dlansy_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 DLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING DLANSY (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
}
#ifdef COMPLEX
/* PLASMA DLANSY */
{
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_dlansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_dlansy_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 DLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING DLANSY (%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_dpemv ( int  argc,
char **  argv 
)

Definition at line 79 of file testing_dpemv.c.

References A, cblas_dcopy(), check_solution(), CORE_dpemv(), ISEED, PLASMA_dplrnt(), 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 */
double *A, *X, *Y, *A0, *Y0, *work;
double 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 = (double *)malloc(lda*n*sizeof(double));
A0 = (double *)malloc(lda*n*sizeof(double));
X = (double *)malloc(lda*n*sizeof(double));
Y = (double *)malloc(lda*n*sizeof(double));
Y0 = (double *)malloc( n*sizeof(double));
work = (double *)malloc( 2*n*sizeof(double));
LAPACKE_dlarnv_work(1, ISEED, 1, &alpha0);
LAPACKE_dlarnv_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_dplrnt(n, n, A, lda, 479 );
PLASMA_dplrnt(n, n, X, lda, 320 );
PLASMA_dplrnt(n, 1, Y0, n, 573 );
printf("\n");
printf("------ TESTS FOR PLASMA DPEMV 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_dlacpy_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_dcopy(n, Y0, 1, Y, incy);
/* DPEMV */
CORE_dpemv( 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, (alpha), incx, (beta), incy, rnorm );
}
nbtests++;
}
}
}
}
if ( nfails )
printf("%d / %d tests failed\n", nfails, nbtests);
printf("***************************************************\n");
if (nfails == 0) {
printf(" ---- TESTING DPEMV ...... PASSED !\n");
}
else {
printf(" ---- TESTING DPEMV ... 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_dposv ( int  argc,
char **  argv 
)

Definition at line 154 of file testing_dposv.c.

References blas_eps, check_factorization(), check_solution(), PLASMA_dlacpy, PLASMA_dplgsy(), PLASMA_dplrnt(), PLASMA_dposv(), PLASMA_dpotrf(), PLASMA_dpotrs(), PLASMA_dtrsm(), PlasmaLeft, PlasmaNonUnit, PlasmaNoTrans, PlasmaTrans, 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;
double *A1 = (double *)malloc(LDA*N*sizeof(double));
double *A2 = (double *)malloc(LDA*N*sizeof(double));
double *B1 = (double *)malloc(LDB*NRHS*sizeof(double));
double *B2 = (double *)malloc(LDB*NRHS*sizeof(double));
/* 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;
trans1 = uplo == PlasmaUpper ? PlasmaTrans : PlasmaNoTrans;
trans2 = uplo == PlasmaUpper ? PlasmaNoTrans : PlasmaTrans;
/*-------------------------------------------------------------
* TESTING DPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_dplgsy( (double)N, N, A1, LDA, 51 );
PLASMA_dlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_dplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_dlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
printf("\n");
printf("------ TESTS FOR PLASMA DPOSV 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 DPOSV */
PLASMA_dposv(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 DPOSV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING DPOSV ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING DPOTRF + DPOTRS
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_dplgsy( (double)N, N, A1, LDA, 51 );
PLASMA_dlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_dplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_dlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* Plasma routines */
PLASMA_dpotrf(uplo, N, A2, LDA);
PLASMA_dpotrs(uplo, N, NRHS, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DPOTRF + DPOTRS 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 DPOTRF + DPOTRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("****************************************************\n");
printf(" - TESTING DPOTRF + DPOTRS ... FAILED !\n");
printf("****************************************************\n");
}
/*-------------------------------------------------------------
* TESTING DPOTRF + ZPTRSM + DTRSM
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_dplgsy( (double)N, N, A1, LDA, 51 );
PLASMA_dlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_dplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_dlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* PLASMA routines */
PLASMA_dpotrf(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 DPOTRF + DTRSM + DTRSM 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 DPOTRF + DTRSM + DTRSM ..... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING DPOTRF + DTRSM + DTRSM ... 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_dpotri ( int  argc,
char **  argv 
)

Definition at line 164 of file testing_dpotri.c.

References blas_eps, check_factorization(), PLASMA_dlacpy, PLASMA_dplgsy(), PLASMA_dpotrf(), PLASMA_dpotri(), 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;
double *A1 = (double *)malloc(LDA*N*sizeof(double));
double *A2 = (double *)malloc(LDA*N*sizeof(double));
double *WORK = (double *)malloc(2*LDA*sizeof(double));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)){
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_dfpinfo( blas_eps );
uplo = PlasmaUpper;
/*-------------------------------------------------------------
* TESTING DPOTRI
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_dplgsy( (double)N, N, A1, LDA, 51 );
PLASMA_dlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
printf("\n");
printf("------ TESTS FOR PLASMA DPOTRI 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 DPOTRF */
PLASMA_dpotrf(uplo, N, A2, LDA);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
/* PLASMA DPOTRI */
PLASMA_dpotri(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 DPOTRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING DPOTRI ... 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_dsyev ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_dsyev.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, min, PLASMA_Alloc_Workspace_dsyev(), PLASMA_Dealloc_Handle_Tile(), PLASMA_dsyev(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_WARNINGS, 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;
double *A1 = NULL;
double *A2 = (double *)malloc(LDAxN*sizeof(double));
double *Q = NULL;
double *W1 = (double *)malloc(N*sizeof(double));
double *W2 = (double *)malloc(N*sizeof(double));
double *work = (double *)malloc(3*N* sizeof(double));
/* 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 DSYEV
*/
/* Initialize A1 */
LAPACKE_dlatms_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 = (double *)malloc(LDQxN*sizeof(double));
A1 = (double *)malloc(LDAxN*sizeof(double));
/* Copy A2 into A1 */
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A2, LDA, A1, LDA);
}
/* PLASMA DSYEV */
PLASMA_dsyev(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 DSYEV 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 DSYEV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYEV ... 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_dsygst ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_dsygst.c.

References check_factorization(), itype, itypestr, PLASMA_dplgsy(), PLASMA_dpotrf(), PLASMA_dsygst(), 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;
double *A1 = (double *)malloc(LDAxN*sizeof(double));
double *A2 = (double *)malloc(LDAxN*sizeof(double));
double *B1 = (double *)malloc(LDBxN*sizeof(double));
double *B2 = (double *)malloc(LDBxN*sizeof(double));
double *Ainit = (double *)malloc(LDAxN*sizeof(double));
double *Binit = (double *)malloc(LDBxN*sizeof(double));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)||(!Ainit)||(!Binit)){
printf("Out of Memory \n ");
return -2;
}
/*----------------------------------------------------------
* TESTING DSYGST
*/
/* Initialize A1 and A2 */
PLASMA_dplgsy(0., N, A1, LDA, 5198);
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and B2 */
PLASMA_dplgsy((double)N, N, B1, LDB, 4231);
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DSYGST 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 DSYGST
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
memcpy(A2, Ainit, LDAxN*sizeof(double));
memcpy(B2, Binit, LDBxN*sizeof(double));
PLASMA_dpotrf(uplo[u], N, B2, LDB);
PLASMA_dsygst(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 DSYGST (%s, %s) ....... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYGST (%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_dsygv ( int  argc,
char **  argv 
)

Definition at line 36 of file testing_dsygv.c.

References check_orthogonality(), check_solution(), itype, itypestr, lapack_const, PLASMA_Alloc_Workspace_dsygv(), PLASMA_Dealloc_Handle_Tile(), PLASMA_dplgsy(), PLASMA_dsygv(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_WARNINGS, 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;
double *A1 = (double *)malloc(LDAxN*sizeof(double));
double *A2 = (double *)malloc(LDAxN*sizeof(double));
double *B1 = (double *)malloc(LDBxN*sizeof(double));
double *B2 = (double *)malloc(LDBxN*sizeof(double));
double *Q = (double *)malloc(LDQxN*sizeof(double));
double *Ainit = (double *)malloc(LDAxN*sizeof(double));
double *Binit = (double *)malloc(LDBxN*sizeof(double));
double *W1 = (double *)malloc(N*sizeof(double));
double *W2 = (double *)malloc(N*sizeof(double));
double *work = (double *)malloc(3*N* sizeof(double));
/* 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 DSYGV
*/
/* Initialize A1 and Ainit */
PLASMA_dplgsy(0., N, A1, LDA, 5198);
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and Binit */
PLASMA_dplgsy((double)N, N, B1, LDB, 4321 );
LAPACKE_dlacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA DSYGV 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 DSYGV
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
LAPACKE_dlaset_work(LAPACK_COL_MAJOR, 'A', LDA, N, 0., 1., Q, LDA);
memcpy(A2, Ainit, LDAxN*sizeof(double));
memcpy(B2, Binit, LDBxN*sizeof(double));
PLASMA_dsygv(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(double));
memcpy(B1, Binit, LDBxN*sizeof(double));
LAPACKE_dsygv( 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 DSYGV (%s, %s) ...................... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYGV (%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_dsymm ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_dsymm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_dplgsy(), PLASMA_dsymm(), 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;
}
double alpha = (double) atol(argv[0]);
double beta = (double) 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;
double *A = (double *)malloc(LDAxM*sizeof(double));
double *B = (double *)malloc(LDBxN*sizeof(double));
double *C = (double *)malloc(LDCxN*sizeof(double));
double *Cinit = (double *)malloc(LDCxN*sizeof(double));
double *Cfinal = (double *)malloc(LDCxN*sizeof(double));
/* 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 DSYMM 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 DSYMM
*/
/* Initialize A */
PLASMA_dplgsy( (double)0., MNmax, A, LDA, 51 );
/* Initialize B */
LAPACKE_dlarnv_work(IONE, ISEED, LDBxN, B);
/* Initialize C */
LAPACKE_dlarnv_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 DSYMM */
PLASMA_dsymm(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 DSYMM (%5s, %5s) ....... PASSED !\n", sidestr[s], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYMM (%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_dsyr2k ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_dsyr2k.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_dplgsy(), PLASMA_dsyr2k(), 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;
}
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 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;
double *A = (double *)malloc(LDAxK*sizeof(double));
double *B = (double *)malloc(LDBxK*sizeof(double));
double *C = (double *)malloc(LDCxN*sizeof(double));
double *Cinit = (double *)malloc(LDCxN*sizeof(double));
double *Cfinal = (double *)malloc(LDCxN*sizeof(double));
/* 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 DSYR2K 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 DSYR2K
*/
/* Initialize A,B */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_dlarnv_work(IONE, ISEED, LDBxK, B);
/* Initialize C */
PLASMA_dplgsy( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(double));
memcpy(Cfinal, C, LDCxN*sizeof(double));
/* PLASMA DSYR2K */
PLASMA_dsyr2k(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 DSYR2K (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYR2K (%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_dsyrk ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_dsyrk.c.

References A, C, check_solution(), IONE, ISEED, max, PLASMA_dplgsy(), PLASMA_dsyrk(), 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;
}
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;
double *A = (double *)malloc(LDAxK*sizeof(double));
double *C = (double *)malloc(LDCxN*sizeof(double));
double *Cinit = (double *)malloc(LDCxN*sizeof(double));
double *Cfinal = (double *)malloc(LDCxN*sizeof(double));
/* 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 DSYRK 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 DSYRK
*/
/* Initialize A */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxK, A);
/* Initialize C */
PLASMA_dplgsy( (double)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(double));
memcpy(Cfinal, C, LDCxN*sizeof(double));
/* PLASMA DSYRK */
PLASMA_dsyrk(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 DSYRK (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING DSYRK (%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_dtrmm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_dtrmm.c.

References A, B, cblas_daxpy(), cblas_dtrmm(), CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_dtrmm(), 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;
}
double alpha = (double) 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);
double *A = (double *)malloc(LDAxM*sizeof(double));
double *B = (double *)malloc(LDBxN*sizeof(double));
double *Binit = (double *)malloc(LDBxN*sizeof(double));
double *Bfinal = (double *)malloc(LDBxN*sizeof(double));
/* 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 DTRMM 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 DTRMM
*/
/* Initialize A, B, C */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_dlarnv_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(double));
memcpy(Bfinal, B, LDBxN*sizeof(double));
/* PLASMA DTRMM */
PLASMA_dtrmm(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 DTRMM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING DTRMM (%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_dtrsm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_dtrsm.c.

References A, B, cblas_daxpy(), cblas_dtrsm(), CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_dtrsm(), 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;
}
double alpha = (double) 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);
double *A = (double *)malloc(LDAxM*sizeof(double));
double *B = (double *)malloc(LDBxN*sizeof(double));
double *Binit = (double *)malloc(LDBxN*sizeof(double));
double *Bfinal = (double *)malloc(LDBxN*sizeof(double));
/* 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 DTRSM 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 DTRSM
*/
/* Initialize A, B, C */
LAPACKE_dlarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_dlarnv_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(double));
memcpy(Bfinal, B, LDBxN*sizeof(double));
/* PLASMA DTRSM */
PLASMA_dtrsm(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 DTRSM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING DTRSM (%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.