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_ssyrk.c File Reference
#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_smain.h"
Include dependency graph for testing_ssyrk.c:

Go to the source code of this file.

Functions

int testing_ssyrk (int argc, char **argv)

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:49 2011

Definition in file testing_ssyrk.c.


Function Documentation

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: