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
time_sgesv_incpiv.c
Go to the documentation of this file.
1 
6 #define _TYPE float
7 #define _PREC float
8 #define _LAMCH LAPACKE_slamch_work
9 
10 #define _NAME "PLASMA_sgesv_incpiv"
11 /* See Lawn 41 page 120 */
12 #define _FMULS (FMULS_GETRF( N, N ) + FMULS_GETRS( N, NRHS ))
13 #define _FADDS (FADDS_GETRF( N, N ) + FADDS_GETRS( N, NRHS ))
14 
15 #include "./timing.c"
16 
17 static int
18 RunTest(int *iparam, float *dparam, real_Double_t *t_)
19 {
20  float *L;
21  int *piv;
22  PASTE_CODE_IPARAM_LOCALS( iparam );
23 
24  if ( M != N ) {
25  fprintf(stderr, "This timing works only with M == N\n");
26  return -1;
27  }
28 
29  /* Allocate Data */
30  PASTE_CODE_ALLOCATE_MATRIX( A, 1, float, LDA, N );
31  PASTE_CODE_ALLOCATE_MATRIX( X, 1, float, LDB, NRHS );
32 
33  /* Initialiaze Data */
34  PLASMA_splrnt( N, N, A, LDA, 51 );
35  PLASMA_splrnt( N, NRHS, X, LDB, 5673 );
36 
38 
39  /* Save A and b */
40  PASTE_CODE_ALLOCATE_COPY( Acpy, check, float, A, LDA, N );
41  PASTE_CODE_ALLOCATE_COPY( B, check, float, X, LDB, NRHS );
42 
43  START_TIMING();
44  PLASMA_sgesv_incpiv( N, NRHS, A, N, L, piv, X, LDB );
45  STOP_TIMING();
46 
47  /* Check the solution */
48  if (check)
49  {
50  dparam[IPARAM_RES] = s_check_solution(N, N, NRHS, Acpy, LDA, B, X, LDB,
51  &(dparam[IPARAM_ANORM]),
52  &(dparam[IPARAM_BNORM]),
53  &(dparam[IPARAM_XNORM]));
54  free(Acpy); free(B);
55  }
56 
57  free( L );
58  free( piv );
59  free( X );
60  free( A );
61 
62 
63  return 0;
64 }