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