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_tile.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_Tile"
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  PLASMA_desc *descL;
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_TILE( descA, 1, float, PlasmaRealFloat, LDA, N, N );
31  PASTE_CODE_ALLOCATE_MATRIX_TILE( descB, 1, float, PlasmaRealFloat, LDB, N, NRHS );
32 
33  /* Initialize A and b */
34  PLASMA_splrnt_Tile( descA, 8796 );
35  PLASMA_splrnt_Tile( descB, 7732 );
36 
37  /* Save AT and bT in lapack layout for check */
38  PASTE_TILE_TO_LAPACK( descA, A, check, float, LDA, N );
39  PASTE_TILE_TO_LAPACK( descB, b, check, float, LDB, NRHS );
40 
41  /* Allocate Workspace */
43 
44  START_TIMING();
45  PLASMA_sgesv_incpiv_Tile( descA, descL, piv, descB );
46  STOP_TIMING();
47 
48  /* Allocate Workspace */
50 
51  /* Check the solution */
52  if ( check )
53  {
54  PASTE_TILE_TO_LAPACK( descB, x, check, float, LDB, NRHS );
55 
56  dparam[IPARAM_RES] = s_check_solution(N, N, NRHS, A, LDA, b, x, LDB,
57  &(dparam[IPARAM_ANORM]),
58  &(dparam[IPARAM_BNORM]),
59  &(dparam[IPARAM_XNORM]));
60  free(A); free(b); free(x);
61  }
62 
63  PASTE_CODE_FREE_MATRIX( descA );
64  PASTE_CODE_FREE_MATRIX( descB );
65  free( piv );
66 
67  return 0;
68 }