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_smain.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_sgemm (int argc, char **argv)
int testing_ssymm (int argc, char **argv)
int testing_ssyrk (int argc, char **argv)
int testing_ssyr2k (int argc, char **argv)
int testing_strmm (int argc, char **argv)
int testing_strsm (int argc, char **argv)
int testing_spemv (int argc, char **argv)
int testing_sposv (int argc, char **argv)
int testing_sgels (int argc, char **argv)
int testing_sgesv (int argc, char **argv)
int testing_spotri (int argc, char **argv)
int testing_sgetri (int argc, char **argv)
int testing_sgeev (int argc, char **argv)
int testing_sgesvd (int argc, char **argv)
int testing_ssyev (int argc, char **argv)
int testing_ssygv (int argc, char **argv)
int testing_ssygst (int argc, char **argv)
int testing_sgecfi (int argc, char **argv)
int testing_sgetmi (int argc, char **argv)
int testing_slange (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 s Tue Nov 22 14:35:50 2011

Definition in file testing_smain.h.


Macro Definition Documentation

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

Definition at line 31 of file testing_smain.h.

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

Definition at line 34 of file testing_smain.h.

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

Definition at line 89 of file testing_sgecfi.c.

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

{
float *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(float);
A = (float *)malloc(size);
B = (float *)malloc(size);
LAPACKE_slarnv_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 SGECFI (%4s => %4s) ...", formatstr[f1], formatstr[f2] );
ret = PLASMA_sgecfi(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/sgecfi_%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_sgeev ( int  argc,
char **  argv 
)
int testing_sgels ( int  argc,
char **  argv 
)

Definition at line 198 of file testing_sgels.c.

References blas_eps, check_factorization(), check_orthogonality(), check_solution(), IONE, ISEED, min, PLASMA_Alloc_Workspace_sgels(), PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_sgelqf(), PLASMA_sgelqs(), PLASMA_sgels(), PLASMA_sgeqrf(), PLASMA_sgeqrs(), PLASMA_sorglq(), PLASMA_sorgqr(), PLASMA_sormlq(), PLASMA_sormqr(), PLASMA_strsm(), 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);
float eps;
int info_ortho, info_solution, info_factorization;
int i,j;
int LDAxN = LDA*N;
int LDBxNRHS = LDB*NRHS;
float *A1 = (float *)malloc(LDA*N*sizeof(float));
float *A2 = (float *)malloc(LDA*N*sizeof(float));
float *B1 = (float *)malloc(LDB*NRHS*sizeof(float));
float *B2 = (float *)malloc(LDB*NRHS*sizeof(float));
float *Q = (float *)malloc(LDA*N*sizeof(float));
float *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 SGELS
*/
/* Initialize A1 and A2 */
LAPACKE_slarnv_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_slarnv_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(float));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
/* PLASMA SGELS */
PLASMA_sgels(PlasmaNoTrans, M, N, NRHS, A2, LDA, T, B2, LDB);
/* PLASMA SGELS */
if (M >= N)
/* Building the economy-size Q */
PLASMA_sorgqr(M, N, K, A2, LDA, T, Q, LDA);
else
/* Building the economy-size Q */
PLASMA_sorglq(M, N, K, A2, LDA, T, Q, LDA);
printf("\n");
printf("------ TESTS FOR PLASMA SGELS 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 SGELS ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING SGELS ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING SGEQRF + SGEQRS or SGELQF + SGELQS
*/
/* Initialize A1 and A2 */
LAPACKE_slarnv_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_slarnv_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(float));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA SGEQRF + SGEQRS 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_sgeqrf(M, N, A2, LDA, T);
PLASMA_sorgqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_sgeqrs(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 SGEQRF + SGEQRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING SGEQRF + SGEQRS ... FAILED !\n");
printf("***************************************************\n");
}
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA SGELQF + SGELQS 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_sgelqf(M, N, A2, LDA, T);
PLASMA_sorglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_sgelqs(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 SGELQF + SGELQS ............ PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING SGELQF + SGELQS ... FAILED !\n");
printf("***************************************************\n");
}
}
/*----------------------------------------------------------
* TESTING SGEQRF + ZORMQR + STRSM
*/
/* Initialize A1 and A2 */
LAPACKE_slarnv_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(float));
LAPACKE_slarnv_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 SGEQRF+ SORMQR + STRSM */
memset((void*)Q, 0, LDA*N*sizeof(float));
for (i = 0; i < K; i++)
Q[LDA*i+i] = 1.0;
if (M >= N) {
printf("\n");
printf("------ TESTS FOR PLASMA SGEQRF + SORMQR + STRSM 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_sgeqrf(M, N, A2, LDA, T);
PLASMA_sorgqr(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_sormqr(PlasmaLeft, PlasmaTrans, M, NRHS, N, A2, LDA, T, B2, LDB);
PLASMA_strsm(PlasmaLeft, PlasmaUpper, PlasmaNoTrans, PlasmaNonUnit, N, NRHS, 1.0, A2, LDA, B2, LDB);
}
else {
printf("\n");
printf("------ TESTS FOR PLASMA SGELQF + SORMLQ + STRSM 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_sgelqf(M, N, A2, LDA, T);
PLASMA_strsm(PlasmaLeft, PlasmaLower, PlasmaNoTrans, PlasmaNonUnit, M, NRHS, 1.0, A2, LDA, B2, LDB);
PLASMA_sorglq(M, N, K, A2, LDA, T, Q, LDA);
PLASMA_sormlq(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 SGEQRF + SORMQR + STRSM .... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING SGELQF + STRSM + SORMLQ .... PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("***************************************************\n");
printf(" - TESTING SGEQRF + SORMQR + STRSM ... FAILED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING SGELQF + STRSM + SORMLQ ... 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_sgemm ( int  argc,
char **  argv 
)

Definition at line 35 of file testing_sgemm.c.

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

Definition at line 155 of file testing_sgesv.c.

References blas_eps, check_solution(), IONE, IPIV, ISEED, PLASMA_sgesv(), PLASMA_sgetrf(), PLASMA_sgetrs, PLASMA_slaswp(), PLASMA_strsm(), 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;
float *A1 = (float *)malloc(LDA*N *sizeof(float));
float *A2 = (float *)malloc(LDA*N *sizeof(float));
float *B1 = (float *)malloc(LDB*NRHS*sizeof(float));
float *B2 = (float *)malloc(LDB*NRHS*sizeof(float));
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 SGESV
*/
/* Initialize A1 and A2 Matrix */
LAPACKE_slarnv_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_slarnv_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 SGESV */
PLASMA_sgesv(N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA SGESV 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 SGESV ...................... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("************************************************\n");
printf(" - TESTING SGESV ... FAILED !\n");
printf("************************************************\n");
}
/*-------------------------------------------------------------
* TESTING SGETRF + SGETRS
*/
/* Initialize A1 and A2 */
LAPACKE_slarnv_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_slarnv_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_sgetrf(N, N, A2, LDA, IPIV);
PLASMA_sgetrs(PlasmaNoTrans, N, NRHS, A2, LDA, IPIV, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA SGETRF + SGETRS 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 SGETRF + SGETRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING SGETRF + SGETRS ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING SGETRF + STRSMPL + STRSM
*/
/* Initialize A1 and A2 */
LAPACKE_slarnv_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_slarnv_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_sgetrf(N, N, A2, LDA, IPIV);
PLASMA_slaswp(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 SGETRF + SLASWP + STRSM + STRSM 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 SGETRF + SLASWP + STRSM + STRSM ... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("**************************************************\n");
printf(" - TESTING SGETRF + SLASWP + STRSM + STRSM ... 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_sgesvd ( int  argc,
char **  argv 
)

Definition at line 33 of file testing_sgesvd.c.

References check_orthogonality(), check_solution(), ISEED, lapack_const, max, min, PLASMA_Alloc_Workspace_sgesvd(), PLASMA_Dealloc_Handle_Tile(), PLASMA_Enable(), PLASMA_ERRORS, PLASMA_HOUSEHOLDER_MODE, PLASMA_HOUSEHOLDER_SIZE, PLASMA_Set(), PLASMA_sgesvd(), 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 *A1 = (float *)malloc(LDA*N*sizeof(float));
float *S1 = (float *) malloc(minMN*sizeof(float));
float *S2 = (float *) malloc(minMN*sizeof(float));
float *work = (float *)malloc(3*max(M, N)* sizeof(float));
float *A2 = NULL;
float *U = NULL;
float *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 SGESVD
*/
/* Initialize A1 */
LAPACKE_slatms_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 = (float *)malloc(LDA*N*sizeof(float));
LAPACKE_slacpy_work(LAPACK_COL_MAJOR, 'A', M, N, A1, LDA, A2, LDA);
}
if ( vecu == PlasmaVec ) {
U = (float *)malloc(M*M*sizeof(float));
LAPACKE_slaset_work(LAPACK_COL_MAJOR, 'A', M, M, 0., 1., U, M);
}
if ( vecvt == PlasmaVec ) {
VT = (float *)malloc(N*N*sizeof(float));
LAPACKE_slaset_work(LAPACK_COL_MAJOR, 'A', N, N, 0., 1., VT, N);
}
/* PLASMA SGESVD */
PLASMA_sgesvd(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 SGESVD 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 SGESVD .. M >= N ........... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" ---- TESTING SGESVD .. M < N ............ PASSED !\n");
printf("***************************************************\n");
}
}
else {
if (M >= N) {
printf("************************************************\n");
printf(" - TESTING SGESVD .. M >= N .. FAILED !\n");
printf("************************************************\n");
}
else {
printf("************************************************\n");
printf(" - TESTING SGESVD .. 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_sgetmi ( int  argc,
char **  argv 
)

Definition at line 46 of file testing_sgetmi.c.

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

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

Definition at line 29 of file testing_sgetri.c.

References check_factorization(), IPIV, PLASMA_sgetrf(), PLASMA_sgetri(), PLASMA_splrnt(), 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;
float *A1 = (float *)malloc(LDA*N*sizeof(float));
float *A2 = (float *)malloc(LDA*N*sizeof(float));
float *WORK = (float *)malloc(2*LDA*sizeof(float));
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 SGETRI
*/
/* Initialize A1 and A2 Matrix */
PLASMA_splrnt(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 SGETRI 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 SGETRF */
PLASMA_sgetrf(N, N, A2, LDA, IPIV);
/* Check the factorization */
info_factorization = check_factorization( N, A1, A2, LDA, IPIV, eps);
/* PLASMA SGETRI */
PLASMA_sgetri(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 SGETRI ..................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING SGETRI ... 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_slange ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_slange.c.

References A, IONE, ISEED, lapack_const, max, min, norm, normstr, PLASMA_slange(), PLASMA_slansy(), 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 *A = (float *)malloc(LDAxN*sizeof(float));
float *work = (float*) malloc(max(M,N)*sizeof(float));
float normplasma, normlapack;
eps = LAPACKE_slamch_work('e');
printf("\n");
printf("------ TESTS FOR PLASMA SLANGE 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 SLANGE
*/
/* Initialize A, B, C */
LAPACKE_slarnv_work(IONE, ISEED, LDAxN, A);
/* PLASMA SLANGE */
for(n=0; n<3; n++) {
normplasma = PLASMA_slange(norm[n], M, N, A, LDA, work);
normlapack = LAPACKE_slange_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 SLANGE (%s)............... PASSED !\n", normstr[n]);
}
else {
printf(" - TESTING SLANGE (%s)... FAILED !\n", normstr[n]);
}
printf("***************************************************\n");
}
/* PLASMA SLANSY */
for(n=0; n<3; n++) {
for(u=0; u<2; u++) {
normplasma = PLASMA_slansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_slansy_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 SLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING SLANSY (%s, %s)... FAILED !\n", normstr[n], uplostr[u]);
}
printf("***************************************************\n");
}
}
#ifdef COMPLEX
/* PLASMA SLANSY */
{
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_slansy(norm[n], uplo[u], min(M,N), A, LDA, work);
normlapack = LAPACKE_slansy_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 SLANSY (%s, %s)......... PASSED !\n", normstr[n], uplostr[u]);
}
else {
printf(" - TESTING SLANSY (%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_spemv ( int  argc,
char **  argv 
)

Definition at line 79 of file testing_spemv.c.

References A, cblas_scopy(), check_solution(), CORE_spemv(), ISEED, PLASMA_splrnt(), 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 */
float *A, *X, *Y, *A0, *Y0, *work;
float 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 = (float *)malloc(lda*n*sizeof(float));
A0 = (float *)malloc(lda*n*sizeof(float));
X = (float *)malloc(lda*n*sizeof(float));
Y = (float *)malloc(lda*n*sizeof(float));
Y0 = (float *)malloc( n*sizeof(float));
work = (float *)malloc( 2*n*sizeof(float));
LAPACKE_slarnv_work(1, ISEED, 1, &alpha0);
LAPACKE_slarnv_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_splrnt(n, n, A, lda, 479 );
PLASMA_splrnt(n, n, X, lda, 320 );
PLASMA_splrnt(n, 1, Y0, n, 573 );
printf("\n");
printf("------ TESTS FOR PLASMA SPEMV 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_slacpy_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_scopy(n, Y0, 1, Y, incy);
/* SPEMV */
CORE_spemv( 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 SPEMV ...... PASSED !\n");
}
else {
printf(" ---- TESTING SPEMV ... 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_sposv ( int  argc,
char **  argv 
)

Definition at line 154 of file testing_sposv.c.

References blas_eps, check_factorization(), check_solution(), PLASMA_slacpy(), PLASMA_splgsy(), PLASMA_splrnt(), PLASMA_sposv(), PLASMA_spotrf(), PLASMA_spotrs(), PLASMA_strsm(), 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]);
float eps;
int uplo;
int info_solution, info_factorization;
int trans1, trans2;
float *A1 = (float *)malloc(LDA*N*sizeof(float));
float *A2 = (float *)malloc(LDA*N*sizeof(float));
float *B1 = (float *)malloc(LDB*NRHS*sizeof(float));
float *B2 = (float *)malloc(LDB*NRHS*sizeof(float));
/* 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;
trans1 = uplo == PlasmaUpper ? PlasmaTrans : PlasmaNoTrans;
trans2 = uplo == PlasmaUpper ? PlasmaNoTrans : PlasmaTrans;
/*-------------------------------------------------------------
* TESTING SPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_splgsy( (float)N, N, A1, LDA, 51 );
PLASMA_slacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_splrnt( N, NRHS, B1, LDB, 371 );
PLASMA_slacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
printf("\n");
printf("------ TESTS FOR PLASMA SPOSV 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 SPOSV */
PLASMA_sposv(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 SPOSV ...................... PASSED !\n");
printf("***************************************************\n");
}
else {
printf("***************************************************\n");
printf(" - TESTING SPOSV ... FAILED !\n");
printf("***************************************************\n");
}
/*-------------------------------------------------------------
* TESTING SPOTRF + SPOTRS
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_splgsy( (float)N, N, A1, LDA, 51 );
PLASMA_slacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_splrnt( N, NRHS, B1, LDB, 371 );
PLASMA_slacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* Plasma routines */
PLASMA_spotrf(uplo, N, A2, LDA);
PLASMA_spotrs(uplo, N, NRHS, A2, LDA, B2, LDB);
printf("\n");
printf("------ TESTS FOR PLASMA SPOTRF + SPOTRS 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 SPOTRF + SPOTRS ............ PASSED !\n");
printf("***************************************************\n");
}
else{
printf("****************************************************\n");
printf(" - TESTING SPOTRF + SPOTRS ... FAILED !\n");
printf("****************************************************\n");
}
/*-------------------------------------------------------------
* TESTING SPOTRF + ZPTRSM + STRSM
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix */
PLASMA_splgsy( (float)N, N, A1, LDA, 51 );
PLASMA_slacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_splrnt( N, NRHS, B1, LDB, 371 );
PLASMA_slacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
/* PLASMA routines */
PLASMA_spotrf(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 SPOTRF + STRSM + STRSM 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 SPOTRF + STRSM + STRSM ..... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING SPOTRF + STRSM + STRSM ... 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_spotri ( int  argc,
char **  argv 
)

Definition at line 164 of file testing_spotri.c.

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

Definition at line 35 of file testing_ssyev.c.

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

Definition at line 32 of file testing_ssygst.c.

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

Definition at line 36 of file testing_ssygv.c.

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

Definition at line 31 of file testing_ssymm.c.

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

Definition at line 32 of file testing_ssyr2k.c.

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

Definition at line 31 of file testing_ssyrk.c.

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

Definition at line 34 of file testing_strmm.c.

References A, B, cblas_saxpy(), cblas_strmm(), CblasColMajor, check_solution(), diag, diagstr, IONE, ISEED, lapack_const, max, PLASMA_strmm(), 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;
}
float alpha = (float) 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);
float *A = (float *)malloc(LDAxM*sizeof(float));
float *B = (float *)malloc(LDBxN*sizeof(float));
float *Binit = (float *)malloc(LDBxN*sizeof(float));
float *Bfinal = (float *)malloc(LDBxN*sizeof(float));
/* 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 STRMM 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 STRMM
*/
/* Initialize A, B, C */
LAPACKE_slarnv_work(IONE, ISEED, LDAxM, A);
LAPACKE_slarnv_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(float));
memcpy(Bfinal, B, LDBxN*sizeof(float));
/* PLASMA STRMM */
PLASMA_strmm(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 STRMM (%s, %s, %s, %s) ...... PASSED !\n",
sidestr[s], uplostr[u], transstr[t], diagstr[d]);
}
else {
printf(" ---- TESTING STRMM (%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_strsm ( int  argc,
char **  argv 
)

Definition at line 34 of file testing_strsm.c.

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