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_dgeqrf_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_dgeqrf_Tile"
11 /* See Lawn 41 page 120 */
12 #define _FMULS FMULS_GEQRF( M, N )
13 #define _FADDS FADDS_GEQRF( M, N )
14 
15 #include "./timing.c"
16 
17 static int
18 RunTest(int *iparam, double *dparam, real_Double_t *t_)
19 {
20  PLASMA_desc *descT;
21  PASTE_CODE_IPARAM_LOCALS( iparam );
22 
23  /* Allocate Data */
24  PASTE_CODE_ALLOCATE_MATRIX_TILE( descA, 1, double, PlasmaRealDouble, LDA, M, N );
25  PLASMA_dplrnt_Tile( descA, 5373 );
26 
27  /* Save A for check */
28  PASTE_TILE_TO_LAPACK( descA, A, ( check && M == N ), double, LDA, N );
29 
30  /* Allocate B for check */
31  PASTE_CODE_ALLOCATE_MATRIX_TILE( descB, (check && M == N), double, PlasmaRealDouble, LDB, M, NRHS );
32 
33  /* Allocate Workspace */
35 
36  /* Do the computations */
37  START_TIMING();
38  PLASMA_dgeqrf_Tile( descA, descT );
39  STOP_TIMING();
40 
41  /* Check the solution */
42  if ( check && M == N )
43  {
44  /* Initialize and save B */
45  PLASMA_dplrnt_Tile( descB, 2264 );
46  PASTE_TILE_TO_LAPACK( descB, B, 1, double, LDB, NRHS );
47 
48  /* Compute the solution */
49  PLASMA_dgeqrs_Tile( descA, descT, descB );
50 
51  /* Copy solution to X */
52  PASTE_TILE_TO_LAPACK( descB, X, 1, double, LDB, NRHS );
53 
54  dparam[IPARAM_RES] = d_check_solution(M, N, NRHS, A, LDA, B, X, LDB,
55  &(dparam[IPARAM_ANORM]),
56  &(dparam[IPARAM_BNORM]),
57  &(dparam[IPARAM_XNORM]));
58 
59  /* Free checking structures */
60  PASTE_CODE_FREE_MATRIX( descB );
61  free( A );
62  free( B );
63  free( X );
64  }
65 
66  /* Free data */
68  PASTE_CODE_FREE_MATRIX( descA );
69 
70  return 0;
71 }