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_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_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  PASTE_CODE_IPARAM_LOCALS( iparam );
21 
22  if ( M != N ) {
23  fprintf(stderr, "This timing works only with M == N\n");
24  return -1;
25  }
26 
27  /* Allocate Data */
28  PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, float, PlasmaRealFloat, LDA, N, N );
29  PASTE_CODE_ALLOCATE_MATRIX_TILE( descB, 1, float, PlasmaRealFloat, LDB, N, NRHS );
30  PASTE_CODE_ALLOCATE_MATRIX( piv, 1, int, N, 1 );
31 
32  /* Initialize AT and bT for Symmetric Positif Matrix */
33  PLASMA_splrnt_Tile( descA, 8796 );
34  PLASMA_splrnt_Tile( descB, 7732 );
35 
36  /* Save AT and bT in lapack layout for check */
37  PASTE_TILE_TO_LAPACK( descA, A, check, float, LDA, N );
38  PASTE_TILE_TO_LAPACK( descB, b, check, float, LDB, NRHS );
39 
40  START_TIMING();
41  PLASMA_sgesv_Tile( descA, piv, descB );
42  STOP_TIMING();
43 
44  /* Check the solution */
45  if ( check )
46  {
47  PASTE_TILE_TO_LAPACK( descB, x, check, float, LDB, NRHS );
48 
49  dparam[IPARAM_RES] = s_check_solution(N, N, NRHS, A, LDA, b, x, LDB,
50  &(dparam[IPARAM_ANORM]),
51  &(dparam[IPARAM_BNORM]),
52  &(dparam[IPARAM_XNORM]));
53  free(A); free(b); free(x);
54  }
55 
56  PASTE_CODE_FREE_MATRIX( descA );
57  PASTE_CODE_FREE_MATRIX( descB );
58  free( piv );
59 
60  return 0;
61 }