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_zgels_tile.c
Go to the documentation of this file.
1 
6 #define _TYPE PLASMA_Complex64_t
7 #define _PREC double
8 #define _LAMCH LAPACKE_dlamch_work
9 
10 #define _NAME "PLASMA_zgels_Tile"
11 /* See Lawn 41 page 120 */
12 #define _FMULS (FMULS_GEQRF( M, N ) + FMULS_GEQRS( M, N, NRHS ))
13 #define _FADDS (FADDS_GEQRF( M, N ) + FADDS_GEQRS( M, N, NRHS ))
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  if ( M != N ) {
24  fprintf(stderr, "This timing works only with M == N\n");
25  return -1;
26  }
27 
28  /* Allocate Data */
31 
32  PLASMA_zplrnt_Tile( descA, 5373 );
33  PLASMA_zplrnt_Tile( descB, 673 );
34 
35  /* Allocate Workspace */
37 
38  /* Save A and B for check */
39  PASTE_TILE_TO_LAPACK( descA, A, check, PLASMA_Complex64_t, LDA, N );
40  PASTE_TILE_TO_LAPACK( descB, B, check, PLASMA_Complex64_t, LDB, NRHS );
41 
42  /* Do the computations */
43  START_TIMING();
44  PLASMA_zgels_Tile( PlasmaNoTrans, descA, descT, descB );
45  STOP_TIMING();
46 
47  /* Allocate Workspace */
49 
50  /* Check the solution */
51  if ( check )
52  {
53  /* Copy solution to X */
54  PASTE_TILE_TO_LAPACK( descB, X, 1, PLASMA_Complex64_t, LDB, NRHS );
55 
56  dparam[IPARAM_RES] = z_check_solution(M, 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 
66  return 0;
67 }