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_cmain.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_cgemm (int argc, char **argv)
int testing_chemm (int argc, char **argv)
int testing_csymm (int argc, char **argv)
int testing_cherk (int argc, char **argv)
int testing_csyrk (int argc, char **argv)
int testing_cher2k (int argc, char **argv)
int testing_csyr2k (int argc, char **argv)
int testing_ctrmm (int argc, char **argv)
int testing_ctrsm (int argc, char **argv)
int testing_cpemv (int argc, char **argv)
int testing_cposv (int argc, char **argv)
int testing_cgels (int argc, char **argv)
int testing_cgesv (int argc, char **argv)
int testing_cpotri (int argc, char **argv)
int testing_cgetri (int argc, char **argv)
int testing_cgeev (int argc, char **argv)
int testing_cgesvd (int argc, char **argv)
int testing_cheev (int argc, char **argv)
int testing_chegv (int argc, char **argv)
int testing_chegst (int argc, char **argv)
int testing_cgecfi (int argc, char **argv)
int testing_cgetmi (int argc, char **argv)
int testing_clange (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 c Tue Nov 22 14:35:50 2011

Definition in file testing_cmain.h.


Macro Definition Documentation

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

Definition at line 31 of file testing_cmain.h.

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

Definition at line 34 of file testing_cmain.h.

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

Definition at line 89 of file testing_cgecfi.c.

References A, B, check_solution(), formatmap, formatstr, ISEED, PLASMA_cgecfi(), PLASMA_DYNAMIC_SCHEDULING, PLASMA_Finalize(), PLASMA_Init(), PLASMA_SCHEDULING_MODE, PLASMA_Set(), PLASMA_SUCCESS, 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_Complex32_t);
A = (PLASMA_Complex32_t *)malloc(size);
B = (PLASMA_Complex32_t *)malloc(size);
LAPACKE_clarnv_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 CGECFI (%4s => %4s) ...", formatstr[f1], formatstr[f2] );
ret = PLASMA_cgecfi(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/cgecfi_%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_cgeev ( int  argc,
char **  argv 
)
int testing_cgels ( int  argc,
char **  argv 
)

Definition at line 198 of file testing_cgels.c.

References blas_eps, check_factorization(), check_orthogonality(), check_solution(), IONE, ISEED, min, PLASMA_Alloc_Workspace_cgels(), PLASMA_cgelqf(), PLASMA_cgelqs(), PLASMA_cgels(), PLASMA_cgeqrf(), PLASMA_cgeqrs(), PLASMA_ctrsm(), PLASMA_cunglq(), PLASMA_cungqr(), PLASMA_cunmlq(), PLASMA_cunmqr(), PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_TREE_HOUSEHOLDER, 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);
float eps;
int info_ortho, info_solution, info_factorization;
int i,j;
int LDAxN = LDA*N;
int LDBxNRHS = LDB*NRHS;
PLASMA_Complex32_t *B1 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *B2 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_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_sfpinfo( blas_eps );
/*----------------------------------------------------------
* TESTING CGELS
*/
/* Initialize A1 and A2 */
LAPACKE_clarnv_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_clarnv_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_Complex32_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
/* PLASMA CGELS */
PLASMA_cgels(PlasmaNoTrans, M, N, NRHS, A2, LDA, T, B2, LDB);
/* PLASMA CGELS */
if (M >= N)
/* Building the economy-size Q */
PLASMA_cungqr(M, N, K, A2, LDA, T, Q, LDA);
else
/* Building the economy-size Q */
PLASMA_cunglq(M, N, K, A2, LDA, T, Q, LDA);
printf("\n");
printf("------ TESTS FOR PLASMA CGELS 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 CGELS ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CGELS ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING CGEQRF + CGEQRS or CGELQF + CGELQS
*/
/* Initialize A1 and A2 */
LAPACKE_clarnv_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_clarnv_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_Complex32_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA CGEQRF + CGEQRS 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_cgeqrf(M, N, A2, LDA, T);
PLASMA_cungqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_cgeqrs(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 CGEQRF + CGEQRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING CGEQRF + CGEQRS ... FAILED !\n");
printf("***************************************************\n");
}
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA CGELQF + CGELQS 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_cgelqf(M, N, A2, LDA, T);
PLASMA_cunglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_cgelqs(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 CGELQF + CGELQS ............ PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING CGELQF + CGELQS ... FAILED !\n");
printf("***************************************************\n");
}
}
/*----------------------------------------------------------
* TESTING CGEQRF + ZORMQR + CTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_clarnv_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_Complex32_t));
LAPACKE_clarnv_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 CGEQRF+ CUNMQR + CTRSM */
memset((void*)Q, 0, LDA*N*sizeof(PLASMA_Complex32_t));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA CGEQRF + CUNMQR + CTRSM 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_cgeqrf(M, N, A2, LDA, T);
PLASMA_cungqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_cunmqr(PlasmaLeft, PlasmaConjTrans, M, NRHS, N, A2, LDA, T, B2, LDB);
PLASMA_ctrsm(PlasmaLeft, PlasmaUpper, PlasmaNoTrans, PlasmaNonUnit, N, NRHS, 1.0, A2, LDA, B2, LDB);
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA CGELQF + CUNMLQ + CTRSM 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_cgelqf(M, N, A2, LDA, T);
PLASMA_ctrsm(PlasmaLeft, PlasmaLower, PlasmaNoTrans, PlasmaNonUnit, M, NRHS, 1.0, A2, LDA, B2, LDB);
PLASMA_cunglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_cunmlq(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 CGEQRF + CUNMQR + CTRSM .... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING CGELQF + CTRSM + CUNMLQ .... PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("***************************************************\n");
printf(" - TESTING CGEQRF + CUNMQR + CTRSM ... FAILED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING CGELQF + CTRSM + CUNMLQ ... 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_cgemm ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_cgemm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_cgemm(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
PLASMA_Complex32_t beta = (PLASMA_Complex32_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]);
float 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_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CGEMM 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 CGEMM
*/
/* Initialize A, B, C */
LAPACKE_clarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_clarnv_work(IONE, ISEED, LDBxN, B);
LAPACKE_clarnv_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 CGEMM */
PLASMA_cgemm(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 CGEMM (%s, %s) ............... PASSED !\n", transstr[ta], transstr[tb]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CGEMM (%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_cgesv ( int  argc,
char **  argv 
)

Definition at line 155 of file testing_cgesv.c.

References blas_eps, check_solution(), IONE, IPIV, ISEED, PLASMA_cgesv(), PLASMA_cgetrf(), PLASMA_cgetrs, PLASMA_claswp(), PLASMA_ctrsm(), 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]);
float eps;
int info_solution;
int i,j;
int LDAxN = LDA*N;
int LDBxNRHS = LDB*NRHS;
PLASMA_Complex32_t *A1 = (PLASMA_Complex32_t *)malloc(LDA*N *sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *A2 = (PLASMA_Complex32_t *)malloc(LDA*N *sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *B1 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *B2 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_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_sfpinfo(blas_eps);
/*----------------------------------------------------------
* TESTING CGESV
*/
/* Initialize A1 and A2 Matrix */
LAPACKE_clarnv_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_clarnv_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 CGESV */
PLASMA_cgesv(N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA CGESV 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 CGESV ...................... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("************************************************\n");
printf(" - TESTING CGESV ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING CGETRF + CGETRS
*/
/* Initialize A1 and A2 */
LAPACKE_clarnv_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_clarnv_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_cgetrf(N, N, A2, LDA, IPIV);
PLASMA_cgetrs(PlasmaNoTrans, N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA CGETRF + CGETRS 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 CGETRF + CGETRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING CGETRF + CGETRS ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING CGETRF + CTRSMPL + CTRSM
*/
/* Initialize A1 and A2 */
LAPACKE_clarnv_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_clarnv_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_cgetrf(N, N, A2, LDA, IPIV);
PLASMA_claswp(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 CGETRF + CLASWP + CTRSM + CTRSM 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 CGETRF + CLASWP + CTRSM + CTRSM ... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("**************************************************\n");
printf(" - TESTING CGETRF + CLASWP + CTRSM + CTRSM ... 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_cgesvd ( int  argc,
char **  argv 
)

Definition at line 33 of file testing_cgesvd.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, max, min, PLASMA_Alloc_Workspace_cgesvd(), PLASMA_cgesvd(), PLASMA_Dealloc_Handle_Tile(), 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;
}
float eps = LAPACKE_slamch_work('e');
float 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;
float rcond = (float) minMN;
float *S1 = (float *) malloc(minMN*sizeof(float));
float *S2 = (float *) malloc(minMN*sizeof(float));
PLASMA_Complex32_t *work = (PLASMA_Complex32_t *)malloc(3*max(M, N)* sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *A2 = NULL;
PLASMA_Complex32_t *U = NULL;
PLASMA_Complex32_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 CGESVD
*/
/* Initialize A1 */
LAPACKE_clatms_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_Complex32_t *)malloc(LDA*N*sizeof(PLASMA_Complex32_t));
LAPACKE_clacpy_work(LAPACK_COL_MAJOR, 'A', M, N, A1, LDA, A2, LDA);
}
if ( vecu == PlasmaVec ) {
U = (PLASMA_Complex32_t *)malloc(M*M*sizeof(PLASMA_Complex32_t));
LAPACKE_claset_work(LAPACK_COL_MAJOR, 'A', M, M, 0., 1., U, M);
}
if ( vecvt == PlasmaVec ) {
VT = (PLASMA_Complex32_t *)malloc(N*N*sizeof(PLASMA_Complex32_t));
LAPACKE_claset_work(LAPACK_COL_MAJOR, 'A', N, N, 0., 1., VT, N);
}
/* PLASMA CGESVD */
PLASMA_cgesvd(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 CGESVD 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 CGESVD .. M >= N ........... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING CGESVD .. M < N ............ PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("************************************************\n");
printf(" - TESTING CGESVD .. M >= N .. FAILED !\n");
printf("************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CGESVD .. 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_cgetmi ( int  argc,
char **  argv 
)

Definition at line 46 of file testing_cgetmi.c.

References A, B, check_solution(), format, formatmap, formatstr, ISEED, PLASMA_cgetmi(), PLASMA_SUCCESS, 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_Complex32_t);
A = (PLASMA_Complex32_t *)malloc(size);
B = (PLASMA_Complex32_t *)malloc(size);
LAPACKE_clarnv_work(1, ISEED, m*n, A);
for(i=0; i<6; i++) {
memcpy(B, A, size);
printf(" - TESTING CGETMI (%4s) ...", formatstr[i]);
ret = PLASMA_cgetmi( 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_cgetri ( int  argc,
char **  argv 
)

Definition at line 29 of file testing_cgetri.c.

References check_factorization(), IPIV, PLASMA_cgetrf(), PLASMA_cgetri(), PLASMA_cplrnt(), 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]);
float eps;
int info_inverse, info_factorization;
int i, j;
PLASMA_Complex32_t *WORK = (PLASMA_Complex32_t *)malloc(2*LDA*sizeof(PLASMA_Complex32_t));
float *D = (float *)malloc(LDA*sizeof(float));
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_slamch_work('e');
/*-------------------------------------------------------------
* TESTING CGETRI
*/
/* Initialize A1 and A2 Matrix */
PLASMA_cplrnt(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 CGETRI 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 CGETRF */
PLASMA_cgetrf(N, N, A2, LDA, IPIV);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, IPIV, eps);
/* PLASMA CGETRI */
PLASMA_cgetri(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 CGETRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING CGETRI ... 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_cheev ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_cheev.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, min, PLASMA_Alloc_Workspace_cheev(), PLASMA_cheev(), PLASMA_Dealloc_Handle_Tile(), 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;
float eps = LAPACKE_slamch_work('e');
float dmax = 1.0;
float 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_Complex32_t *A1 = NULL;
float *W1 = (float *)malloc(N*sizeof(float));
float *W2 = (float *)malloc(N*sizeof(float));
PLASMA_Complex32_t *work = (PLASMA_Complex32_t *)malloc(3*N* sizeof(PLASMA_Complex32_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 CHEEV
*/
/* Initialize A1 */
LAPACKE_clatms_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_slasrt_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_Complex32_t *)malloc(LDQxN*sizeof(PLASMA_Complex32_t));
A1 = (PLASMA_Complex32_t *)malloc(LDAxN*sizeof(PLASMA_Complex32_t));
/* Copy A2 into A1 */
LAPACKE_clacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A2, LDA, A1, LDA);
}
/* PLASMA CHEEV */
PLASMA_cheev(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 CHEEV 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 CHEEV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CHEEV ... 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_chegst ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_chegst.c.

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

Definition at line 36 of file testing_chegv.c.

References check_orthogonality(), check_solution(), itype, itypestr, lapack_const, PLASMA_Alloc_Workspace_chegv(), PLASMA_chegv(), PLASMA_cplghe(), PLASMA_Dealloc_Handle_Tile(), 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;
}
float eps = LAPACKE_slamch_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_Complex32_t *Ainit = (PLASMA_Complex32_t *)malloc(LDAxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Binit = (PLASMA_Complex32_t *)malloc(LDBxN*sizeof(PLASMA_Complex32_t));
float *W1 = (float *)malloc(N*sizeof(float));
float *W2 = (float *)malloc(N*sizeof(float));
PLASMA_Complex32_t *work = (PLASMA_Complex32_t *)malloc(3*N* sizeof(PLASMA_Complex32_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 CHEGV
*/
/* Initialize A1 and Ainit */
PLASMA_cplghe(0., N, A1, LDA, 5198);
LAPACKE_clacpy_work(LAPACK_COL_MAJOR, 'A', N, N, A1, LDA, Ainit, LDA);
/* Initialize B1 and Binit */
PLASMA_cplghe((float)N, N, B1, LDB, 4321 );
LAPACKE_clacpy_work(LAPACK_COL_MAJOR, 'A', N, N, B1, LDB, Binit, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA CHEGV 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 CHEGV
*/
for (i=0; i<3; i++) {
for (u=0; u<2; u++) {
LAPACKE_claset_work(LAPACK_COL_MAJOR, 'A', LDA, N, 0., 1., Q, LDA);
memcpy(A2, Ainit, LDAxN*sizeof(PLASMA_Complex32_t));
memcpy(B2, Binit, LDBxN*sizeof(PLASMA_Complex32_t));
PLASMA_chegv(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_Complex32_t));
memcpy(B1, Binit, LDBxN*sizeof(PLASMA_Complex32_t));
LAPACKE_chegv( 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 CHEGV (%s, %s) ...................... PASSED !\n", itypestr[i], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CHEGV (%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_chemm ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_chemm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_chemm(), PLASMA_cplghe(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
PLASMA_Complex32_t beta = (PLASMA_Complex32_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);
float eps;
int info_solution;
int i, j, s, u;
int LDAxM = LDA*MNmax;
int LDBxN = LDB*N;
int LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CHEMM 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 CHEMM
*/
/* Initialize A */
PLASMA_cplghe( (float)0., MNmax, A, LDA, 51 );
/* Initialize B */
LAPACKE_clarnv_work(IONE, ISEED, LDBxN, B);
/* Initialize C */
LAPACKE_clarnv_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 CHEMM */
PLASMA_chemm(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 CHEMM (%5s, %5s) ....... PASSED !\n", sidestr[s], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CHEMM (%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_cher2k ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_cher2k.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_cher2k(), PLASMA_cplghe(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
float beta = (float) 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);
float eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDBxK = LDB*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CHER2K 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 CHER2K
*/
/* Initialize A,B */
LAPACKE_clarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_clarnv_work(IONE, ISEED, LDBxK, B);
/* Initialize C */
PLASMA_cplghe( (float)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_Complex32_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CHER2K */
PLASMA_cher2k(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 CHER2K (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CHER2K (%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_cherk ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_cherk.c.

References A, C, check_solution(), IONE, ISEED, max, PLASMA_cherk(), PLASMA_cplgsy(), 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;
}
float alpha = (float) atol(argv[0]);
float beta = (float) 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);
float eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CHERK 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 CHERK
*/
/* Initialize A */
LAPACKE_clarnv_work(IONE, ISEED, LDAxK, A);
/* Initialize C */
PLASMA_cplgsy( (float)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_Complex32_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CHERK */
PLASMA_cherk(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 CHERK (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CHERK (%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_clange ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_clange.c.

References A, IONE, ISEED, lapack_const, max, min, norm, normstr, PLASMA_clange(), PLASMA_clanhe(), PLASMA_clansy(), 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;
float eps;
float *work = (float*) malloc(max(M,N)*sizeof(float));
float normplasma, normlapack;
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CLANGE 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 CLANGE
*/
/* Initialize A, B, C */
LAPACKE_clarnv_work(IONE, ISEED, LDAxN, A);
/* PLASMA CLANGE */
for(n=0; n<3; n++) {
normplasma = PLASMA_clange(norm[n], M, N, A, LDA, work);
normlapack = LAPACKE_clange_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 CLANGE (%s)............... PASSED !\n", normstr[n]);
}
else {
printf(" - TESTING CLANGE (%s)... FAILED !\n", normstr[n]);
}
printf("***************************************************\n");
}
/* PLASMA CLANSY */
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_clansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_clansy_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 CLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING CLANSY (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
}
#ifdef COMPLEX
/* PLASMA CLANHE */
{
int j;
for (j=0; j<min(M,N); j++) {
A[j*LDA+j] -= I*cimagf(A[j*LDA+j]);
}
}
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_clanhe(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_clanhe_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 CLANHE (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING CLANHE (%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_cpemv ( int  argc,
char **  argv 
)

Definition at line 79 of file testing_cpemv.c.

References A, cblas_ccopy(), check_solution(), CORE_cpemv(), ISEED, PLASMA_cplrnt(), 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_Complex32_t *A, *X, *Y, *A0, *Y0, *work;
PLASMA_Complex32_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;
float rnorm;
float eps = LAPACKE_slamch_work('e');
/* Allocate Data */
A = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t));
A0 = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t));
X = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t));
Y = (PLASMA_Complex32_t *)malloc(lda*n*sizeof(PLASMA_Complex32_t));
Y0 = (PLASMA_Complex32_t *)malloc( n*sizeof(PLASMA_Complex32_t));
work = (PLASMA_Complex32_t *)malloc( 2*n*sizeof(PLASMA_Complex32_t));
LAPACKE_clarnv_work(1, ISEED, 1, &alpha0);
LAPACKE_clarnv_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_cplrnt(n, n, A, lda, 479 );
PLASMA_cplrnt(n, n, X, lda, 320 );
PLASMA_cplrnt(n, 1, Y0, n, 573 );
printf("\n");
printf("------ TESTS FOR PLASMA CPEMV 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_clacpy_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_ccopy(n, Y0, 1, Y, incy);
/* CPEMV */
CORE_cpemv( 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, crealf(alpha), incx, crealf(beta), incy, rnorm );
}
nbtests++;
}
}
}
}
if ( nfails )
printf("%d / %d tests failed\n", nfails, nbtests);
printf("***************************************************\n");
if (nfails == 0) {
printf(" ---- TESTING CPEMV ...... PASSED !\n");
}
else {
printf(" ---- TESTING CPEMV ... 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_cposv ( int  argc,
char **  argv 
)

Definition at line 154 of file testing_cposv.c.

References blas_eps, check_factorization(), check_solution(), PLASMA_clacpy(), PLASMA_cplghe(), PLASMA_cplrnt(), PLASMA_cposv(), PLASMA_cpotrf(), PLASMA_cpotrs(), PLASMA_ctrsm(), 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]);
float eps;
int uplo;
int info_solution, info_factorization;
int trans1, trans2;
PLASMA_Complex32_t *B1 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *B2 = (PLASMA_Complex32_t *)malloc(LDB*NRHS*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)||(!B1)||(!B2)){
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_sfpinfo( blas_eps );
uplo = PlasmaUpper;
/*-------------------------------------------------------------
* TESTING CPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_cplghe( (float)N, N, A1, LDA, 51 );
PLASMA_clacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_cplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_clacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
printf("\n");
printf("------ TESTS FOR PLASMA CPOSV 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 CPOSV */
PLASMA_cposv(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 CPOSV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING CPOSV ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING CPOTRF + CPOTRS
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_cplghe( (float)N, N, A1, LDA, 51 );
PLASMA_clacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_cplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_clacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* Plasma routines */
PLASMA_cpotrf(uplo, N, A2, LDA);
PLASMA_cpotrs(uplo, N, NRHS, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA CPOTRF + CPOTRS 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 CPOTRF + CPOTRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("****************************************************\n");
printf(" - TESTING CPOTRF + CPOTRS ... FAILED !\n");
printf("****************************************************\n");
}
/*-------------------------------------------------------------
* TESTING CPOTRF + ZPTRSM + CTRSM
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_cplghe( (float)N, N, A1, LDA, 51 );
PLASMA_clacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_cplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_clacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* PLASMA routines */
PLASMA_cpotrf(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 CPOTRF + CTRSM + CTRSM 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 CPOTRF + CTRSM + CTRSM ..... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING CPOTRF + CTRSM + CTRSM ... 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_cpotri ( int  argc,
char **  argv 
)

Definition at line 164 of file testing_cpotri.c.

References blas_eps, check_factorization(), PLASMA_clacpy(), PLASMA_cplghe(), PLASMA_cpotrf(), PLASMA_cpotri(), 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]);
float eps;
int uplo;
int info_inverse, info_factorization;
PLASMA_Complex32_t *WORK = (PLASMA_Complex32_t *)malloc(2*LDA*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ((!A1)||(!A2)){
printf("Out of Memory \n ");
return -2;
}
eps = BLAS_sfpinfo( blas_eps );
uplo = PlasmaUpper;
/*-------------------------------------------------------------
* TESTING CPOTRI
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_cplghe( (float)N, N, A1, LDA, 51 );
PLASMA_clacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
printf("\n");
printf("------ TESTS FOR PLASMA CPOTRI 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 CPOTRF */
PLASMA_cpotrf(uplo, N, A2, LDA);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, uplo, eps);
/* PLASMA CPOTRI */
PLASMA_cpotri(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 CPOTRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING CPOTRI ... 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_csymm ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_csymm.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_cplgsy(), PLASMA_csymm(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
PLASMA_Complex32_t beta = (PLASMA_Complex32_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);
float eps;
int info_solution;
int i, j, s, u;
int LDAxM = LDA*MNmax;
int LDBxN = LDB*N;
int LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ((!A)||(!B)||(!Cinit)||(!Cfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CSYMM 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 CSYMM
*/
/* Initialize A */
PLASMA_cplgsy( (float)0., MNmax, A, LDA, 51 );
/* Initialize B */
LAPACKE_clarnv_work(IONE, ISEED, LDBxN, B);
/* Initialize C */
LAPACKE_clarnv_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 CSYMM */
PLASMA_csymm(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 CSYMM (%5s, %5s) ....... PASSED !\n", sidestr[s], uplostr[u]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CSYMM (%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_csyr2k ( int  argc,
char **  argv 
)

Definition at line 32 of file testing_csyr2k.c.

References A, B, C, check_solution(), IONE, ISEED, max, PLASMA_cplgsy(), PLASMA_csyr2k(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
PLASMA_Complex32_t beta = (PLASMA_Complex32_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);
float eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDBxK = LDB*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CSYR2K 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 CSYR2K
*/
/* Initialize A,B */
LAPACKE_clarnv_work(IONE, ISEED, LDAxK, A);
LAPACKE_clarnv_work(IONE, ISEED, LDBxK, B);
/* Initialize C */
PLASMA_cplgsy( (float)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex32_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CSYR2K */
PLASMA_csyr2k(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 CSYR2K (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CSYR2K (%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_csyrk ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_csyrk.c.

References A, C, check_solution(), IONE, ISEED, max, PLASMA_cplgsy(), PLASMA_csyrk(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
PLASMA_Complex32_t beta = (PLASMA_Complex32_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);
float eps;
int info_solution;
int u, t;
size_t LDAxK = LDA*NKmax;
size_t LDCxN = LDC*N;
PLASMA_Complex32_t *Cinit = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Cfinal = (PLASMA_Complex32_t *)malloc(LDCxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!Cinit) || (!Cfinal) ){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CSYRK 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 CSYRK
*/
/* Initialize A */
LAPACKE_clarnv_work(IONE, ISEED, LDAxK, A);
/* Initialize C */
PLASMA_cplgsy( (float)0., N, C, LDC, 51 );
for (u=0; u<2; u++) {
for (t=0; t<2; t++) {
memcpy(Cinit, C, LDCxN*sizeof(PLASMA_Complex32_t));
memcpy(Cfinal, C, LDCxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CSYRK */
PLASMA_csyrk(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 CSYRK (%5s, %s) ........... PASSED !\n", uplostr[u], transstr[t]);
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING CSYRK (%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_ctrmm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_ctrmm.c.

References A, B, cblas_caxpy(), cblas_ctrmm(), CBLAS_SADDR, CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_ctrmm(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int LDB = atoi(argv[4]);
float eps;
int info_solution;
int s, u, t, d, i;
int LDAxM = LDA*max(M,N);
int LDBxN = LDB*max(M,N);
PLASMA_Complex32_t *Binit = (PLASMA_Complex32_t *)malloc(LDBxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Bfinal = (PLASMA_Complex32_t *)malloc(LDBxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CTRMM 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 CTRMM
*/
/* Initialize A, B, C */
LAPACKE_clarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_clarnv_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_Complex32_t));
memcpy(Bfinal, B, LDBxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CTRMM */
PLASMA_ctrmm(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 CTRMM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING CTRMM (%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_ctrsm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_ctrsm.c.

References A, B, cblas_caxpy(), cblas_ctrsm(), CBLAS_SADDR, CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_ctrsm(), 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_Complex32_t alpha = (PLASMA_Complex32_t) atol(argv[0]);
int M = atoi(argv[1]);
int N = atoi(argv[2]);
int LDA = atoi(argv[3]);
int LDB = atoi(argv[4]);
float eps;
int info_solution;
int s, u, t, d, i;
int LDAxM = LDA*max(M,N);
int LDBxN = LDB*max(M,N);
PLASMA_Complex32_t *Binit = (PLASMA_Complex32_t *)malloc(LDBxN*sizeof(PLASMA_Complex32_t));
PLASMA_Complex32_t *Bfinal = (PLASMA_Complex32_t *)malloc(LDBxN*sizeof(PLASMA_Complex32_t));
/* Check if unable to allocate memory */
if ( (!A) || (!B) || (!Binit) || (!Bfinal)){
printf("Out of Memory \n ");
return -2;
}
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA CTRSM 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 CTRSM
*/
/* Initialize A, B, C */
LAPACKE_clarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_clarnv_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_Complex32_t));
memcpy(Bfinal, B, LDBxN*sizeof(PLASMA_Complex32_t));
/* PLASMA CTRSM */
PLASMA_ctrsm(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 CTRSM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING CTRSM (%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.