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_dsposv.c File Reference

Test mixed precision solution with iterative refinement routine PLASMA_dsposv. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <plasma.h>
#include <cblas.h>
#include <lapacke.h>
#include <core_blas.h>
#include "testing_zmain.h"
Include dependency graph for testing_dsposv.c:

Go to the source code of this file.

Functions

int testing_dsposv (int argc, char **argv)

Detailed Description

Test mixed precision solution with iterative refinement routine PLASMA_dsposv.

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:
Emmanuel Agullo
Mathieu Faverge
Date:
2010-11-15 ds Tue Nov 22 14:35:50 2011

Definition in file testing_dsposv.c.


Function Documentation

int testing_dsposv ( int  argc,
char **  argv 
)

Definition at line 31 of file testing_dsposv.c.

References check_solution(), PLASMA_dlacpy, PLASMA_dplgsy(), PLASMA_dplrnt(), PLASMA_dsposv(), PLASMA_SUCCESS, PlasmaLower, PlasmaUpperLower, uplo, and USAGE.

{
/* Check for number of arguments*/
if (argc != 4){
USAGE("CPOSV", "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]);
int ITER;
double eps;
int uplo;
int info;
int info_solution = 0; /*, info_factorization;*/
double *A1 = (double *)malloc(LDA*N *sizeof(double));
double *A2 = (double *)malloc(LDA*N *sizeof(double));
double *B1 = (double *)malloc(LDB*NRHS*sizeof(double));
double *B2 = (double *)malloc(LDB*NRHS*sizeof(double));
/* Check if unable to allocate memory */
if ( (!A1) || (!A2) || (!B1) || (!B2) ){
printf("Out of Memory \n ");
exit(0);
}
eps = LAPACKE_dlamch_work('e');
/*-------------------------------------------------------------
* TESTING DSPOSV
*/
/* Initialize A1 and A2 for Symmetric Positif Matrix (Hessenberg in the complex case) */
PLASMA_dplgsy( (double)N, N, A1, LDA, 51 );
PLASMA_dlacpy( PlasmaUpperLower, N, N, A1, LDA, A2, LDA );
/* Initialize B1 and B2 */
PLASMA_dplrnt( N, NRHS, B1, LDB, 371 );
PLASMA_dlacpy( PlasmaUpperLower, N, NRHS, B1, LDB, B2, LDB );
printf("\n");
printf("------ TESTS FOR PLASMA DSPOSV 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 DSPOSV */
uplo = PlasmaLower;
info = PLASMA_dsposv(uplo, N, NRHS, A2, LDA, B1, LDB, B2, LDB, &ITER);
if (info != PLASMA_SUCCESS ) {
printf("PLASMA_dsposv is not completed: info = %d\n", info);
info_solution = 1;
} else {
printf(" Solution obtained with %d iterations\n", ITER);
/* 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 DSPOSV ..................... PASSED !\n");
printf("***************************************************\n");
}
else{
printf("***************************************************\n");
printf(" - TESTING DSPOSV .. 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: