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_cgecfi.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_cgecfi"
11 /* See Lawn 41 page 120 */
12 #define _FMULS (0.0)
13 #define _FADDS (M * N * sizeof(_TYPE))
14 
15 #include "./timing.c"
16 
17 int c_check_conversion(int m, int n, int mba, int nba, int mbb, int nbb,
19  int (*mapA)(int, int, int, int, int, int), int (*mapB)(int, int, int, int, int, int)) {
20  int i, j;
21 
22  for( j=0; j<n; j++) {
23  for (i=0; i<m; i++) {
24  if (A[ mapA(m, n, mba, nba, i, j) ] != B[ mapB(m, n, mbb, nbb, i, j) ] ) {
25  return -1;
26  }
27  }
28  }
29  return 0;
30 }
31 
32 static int
33 RunTest(int *iparam, _PREC *dparam, real_Double_t *t_)
34 {
35  PASTE_CODE_IPARAM_LOCALS( iparam );
36 
37  LDA = M;
38 
39  dparam[IPARAM_ANORM] = (_PREC)M;
40  dparam[IPARAM_BNORM] = (_PREC)_FADDS;
41 
42  /* Allocate Data */
44 
45  /* Initialize Data */
46  PLASMA_cplrnt(M, N, A, LDA, 3456);
47 
48  /* Save AT in lapack layout for check */
49  PASTE_CODE_ALLOCATE_COPY( Acpy, check, PLASMA_Complex32_t, A, LDA, N );
50 
51  START_TIMING();
52  PLASMA_cgecfi( M, N, A, PlasmaCM, M, 1, PlasmaCCRB, MB, NB);
53  STOP_TIMING();
54 
55  /* Check the solution */
56  if (check)
57  {
58  dparam[IPARAM_RES] = (_PREC)c_check_conversion(M, N, M, 1, MB, NB, Acpy, A, map_CM, map_CCRB);
59  free(Acpy);
60  }
61 
62  free( A );
63  return 0;
64 }