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_dgetrf_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_dgetrf_Tile"
11 /* See Lawn 41 page 120 */
12 #define _FMULS FMULS_GETRF(M, N)
13 #define _FADDS FADDS_GETRF(M, N)
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 
22  if ( M != N && check ) {
23  fprintf(stderr, "Check cannot be perfomed with M != N\n");
24  check = 0;
25  }
26 
27  /* Allocate Data */
28  PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, double, PlasmaRealDouble, LDA, M, N );
29  PASTE_CODE_ALLOCATE_MATRIX( piv, 1, int, min(M, N), 1 );
30 
31  PLASMA_dplrnt_Tile(descA, 3456);
32 
33  /* Save AT in lapack layout for check */
34  PASTE_TILE_TO_LAPACK( descA, A, check, double, LDA, N );
35 
36  START_TIMING();
37  PLASMA_dgetrf_Tile( descA, piv );
38  STOP_TIMING();
39 
40  /* Check the solution */
41  if ( check )
42  {
43  PASTE_CODE_ALLOCATE_MATRIX_TILE( descB, 1, double, PlasmaRealDouble, LDB, N, NRHS );
44  PLASMA_dplrnt_Tile( descB, 7732 );
45  PASTE_TILE_TO_LAPACK( descB, b, check, double, LDB, NRHS );
46 
47  PLASMA_dgetrs_Tile( PlasmaNoTrans, descA, piv, descB );
48 
49  PASTE_TILE_TO_LAPACK( descB, x, check, double, LDB, NRHS );
50  dparam[IPARAM_RES] = d_check_solution(M, 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  free( piv );
59 
60  return 0;
61 }