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_sgecfi.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <lapacke.h>
#include <plasma.h>
#include "testing_smain.h"
Include dependency graph for testing_sgecfi.c:

Go to the source code of this file.

Functions

int testing_sgecfi (int argc, char **argv)

Detailed Description

PLASMA testings module PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

This program tests the implementation of the inplace format conversion based on the GKK algorithm by Gustavson, Karlsson, Kagstrom.

Version:
2.4.5
Author:
Mathieu Faverge
Date:
2010-11-15

s Tue Nov 22 14:35:50 2011

Purpose : Test all the possibilities of matrix conversion (6*6)

Definition in file testing_sgecfi.c.


Function Documentation

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: