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_dsgesv_tile.c
Go to the documentation of this file.
1 
6 #define _TYPE double
7 #define _PREC double
8 #define _LAMCH LAPACKE_dlamch_work
9 
10 #define _NAME "PLASMA_dgesv_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, double *dparam, real_Double_t *t_)
19 {
20  PASTE_CODE_IPARAM_LOCALS( iparam );
21  int iter;
22 
23  if ( M != N ) {
24  fprintf(stderr, "This timing works only with M == N\n");
25  return -1;
26  }
27 
28  /* Allocate Data */
29  PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, double, PlasmaRealDouble, LDA, N, N );
30  PASTE_CODE_ALLOCATE_MATRIX_TILE( descB, 1, double, PlasmaRealDouble, LDB, N, NRHS );
31  PASTE_CODE_ALLOCATE_MATRIX_TILE( descX, 1, double, PlasmaRealDouble, LDB, N, NRHS );
32  PASTE_CODE_ALLOCATE_MATRIX( piv, 1, int, N, 1 );
33 
34  PLASMA_dplrnt_Tile(descA, 3577);
35  PLASMA_dplrnt_Tile(descB, 5723);
36 
37  /* Save AT and bT in lapack layout for check */
38  PASTE_TILE_TO_LAPACK( descA, A, check, double, LDA, N );
39  PASTE_TILE_TO_LAPACK( descB, b, check, double, LDB, NRHS );
40 
41  START_TIMING();
42  PLASMA_dsgesv_Tile( descA, piv, descB, descX, &iter );
43  STOP_TIMING();
44 
45  /* Check the solution */
46  if (check)
47  {
48  PASTE_TILE_TO_LAPACK( descX, x, check, double, LDB, NRHS );
49 
50  dparam[IPARAM_RES] = d_check_solution(N, N, NRHS, A, LDA, b, x, LDB,
51  &(dparam[IPARAM_ANORM]),
52  &(dparam[IPARAM_BNORM]),
53  &(dparam[IPARAM_XNORM]));
54  free(A); free(b); free(x);
55  }
56 
57  PASTE_CODE_FREE_MATRIX( descA );
58  PASTE_CODE_FREE_MATRIX( descB );
59  PASTE_CODE_FREE_MATRIX( descX );
60  free( piv );
61 
62  return 0;
63 }