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_incpiv.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_incpiv_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  double *L;
21  int *piv;
22  PASTE_CODE_IPARAM_LOCALS( iparam );
23 
24  if ( M != N && check ) {
25  fprintf(stderr, "Check cannot be perfomed with M != N\n");
26  check = 0;
27  }
28 
29  /* Allocate Data */
30  PASTE_CODE_ALLOCATE_MATRIX( A, 1, double, LDA, N );
31 
32  /* Initialize Data */
33  PLASMA_dplrnt(M, N, A, LDA, 3456);
34 
35  /* Allocate Workspace */
37 
38  /* Save AT in lapack layout for check */
39  PASTE_CODE_ALLOCATE_COPY( Acpy, check, double, A, LDA, N );
40 
41  START_TIMING();
42  PLASMA_dgetrf_incpiv( M, N, A, LDA, L, piv );
43  STOP_TIMING();
44 
45  /* Check the solution */
46  if ( check )
47  {
48  PASTE_CODE_ALLOCATE_MATRIX( X, 1, double, LDB, NRHS );
49  PLASMA_dplrnt( N, NRHS, X, LDB, 5673 );
50  PASTE_CODE_ALLOCATE_COPY( B, 1, double, X, LDB, NRHS );
51 
52  PLASMA_dgetrs_incpiv( PlasmaNoTrans, N, NRHS, A, LDA, L, piv, X, LDB );
53 
54  dparam[IPARAM_RES] = d_check_solution(M, N, NRHS, Acpy, LDA, B, X, LDB,
55  &(dparam[IPARAM_ANORM]),
56  &(dparam[IPARAM_BNORM]),
57  &(dparam[IPARAM_XNORM]));
58 
59  free( Acpy ); free( B ); free( X );
60  }
61 
62  free( A );
63  free( L );
64  free( piv );
65 
66  return 0;
67 }