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_cpotrf.c
Go to the documentation of this file.
1 
6 #define _TYPE PLASMA_Complex32_t
7 #define _PREC float
8 #define _LAMCH LAPACKE_slamch_work
9 
10 #define _NAME "PLASMA_cpotrf"
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, float *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 */
27 
28  /* Initialiaze Data */
29  PLASMA_cplghe( (float)N, N, A, LDA, 51 );
30 
31  /* Save A and b */
32  PASTE_CODE_ALLOCATE_COPY( A2, check, PLASMA_Complex32_t, A, LDA, N );
33 
34  /* PLASMA CPOSV */
35  START_TIMING();
36  PLASMA_cpotrf(uplo, N, A, LDA);
37  STOP_TIMING();
38 
39  /* Check the solution */
40  if (check)
41  {
42  PASTE_CODE_ALLOCATE_MATRIX( B, check, PLASMA_Complex32_t, LDB, NRHS );
43  PLASMA_cplrnt( N, NRHS, B, LDB, 5673 );
44  PASTE_CODE_ALLOCATE_COPY( X, check, PLASMA_Complex32_t, B, LDB, NRHS );
45 
46  PLASMA_cpotrs(uplo, N, NRHS, A, LDA, X, LDB);
47 
48  dparam[IPARAM_RES] = c_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 }