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_dpotrf.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_dpotrf"
11 /* See Lawn 41 page 120 */
12 #define _FMULS FMULS_POTRF( N )
13 #define _FADDS FADDS_POTRF( 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  int uplo = PlasmaLower;
22 
23  LDA = max(LDA, N);
24 
25  /* Allocate Data */
26  PASTE_CODE_ALLOCATE_MATRIX( A, 1, double, LDA, N );
27 
28  /* Initialiaze Data */
29  PLASMA_dplgsy( (double)N, N, A, LDA, 51 );
30 
31  /* Save A and b */
32  PASTE_CODE_ALLOCATE_COPY( A2, check, double, A, LDA, N );
33 
34  /* PLASMA DPOSV */
35  START_TIMING();
36  PLASMA_dpotrf(uplo, N, A, LDA);
37  STOP_TIMING();
38 
39  /* Check the solution */
40  if (check)
41  {
42  PASTE_CODE_ALLOCATE_MATRIX( B, check, double, LDB, NRHS );
43  PLASMA_dplrnt( N, NRHS, B, LDB, 5673 );
44  PASTE_CODE_ALLOCATE_COPY( X, check, double, B, LDB, NRHS );
45 
46  PLASMA_dpotrs(uplo, N, NRHS, A, LDA, X, LDB);
47 
48  dparam[IPARAM_RES] = d_check_solution(N, N, NRHS, A2, LDA, B, X, LDB,
49  &(dparam[IPARAM_ANORM]),
50  &(dparam[IPARAM_BNORM]),
51  &(dparam[IPARAM_XNORM]));
52 
53  free(A2); free(B); free(X);
54  }
55 
56  free(A);
57 
58  return 0;
59 }