basicbenchmark.h File Reference

Go to the source code of this file.

Enumerations

enum  { LazyEval , EarlyEval , OmpEval }
 

Functions

template<int Mode, typename MatrixType >
void benchBasic_loop (const MatrixType &I, MatrixType &m, int iterations) __attribute__((noinline))
 
template<int Mode, typename MatrixType >
double benchBasic (const MatrixType &mat, int size, int tries) __attribute__((noinline))
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LazyEval 
EarlyEval 
OmpEval 
@ LazyEval
Definition: basicbenchmark.h:5
@ EarlyEval
Definition: basicbenchmark.h:5
@ OmpEval
Definition: basicbenchmark.h:5

Function Documentation

◆ benchBasic()

template<int Mode, typename MatrixType >
double benchBasic ( const MatrixType mat,
int  size,
int  tries 
)
34  {
35  const int rows = mat.rows();
36  const int cols = mat.cols();
37 
40 
42 
44  for (uint t = 0; t < tries; ++t) {
46  timer.start();
47  benchBasic_loop<Mode>(I, m, iterations);
48  timer.stop();
49  cerr << m;
50  }
51  return timer.value();
52 };
void initMatrix_identity(MatrixType &mat) __attribute__((noinline))
Definition: BenchUtil.h:31
void initMatrix_random(MatrixType &mat) __attribute__((noinline))
Definition: BenchUtil.h:24
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Definition: BenchTimer.h:55
Index cols() const
Definition: SparseMatrix.h:161
Index rows() const
Definition: SparseMatrix.h:159
int * m
Definition: level2_cplx_impl.h:294
#define I
Definition: main.h:127
t
Definition: plotPSD.py:36
double timer
Definition: oomph_metis_from_parmetis_3.1.1/struct.h:210

References cols, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::cols(), I, initMatrix_identity(), initMatrix_random(), m, rows, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::rows(), and plotPSD::t.

◆ benchBasic_loop()

template<int Mode, typename MatrixType >
void benchBasic_loop ( const MatrixType I,
MatrixType m,
int  iterations 
)
11  {
12  for (int a = 0; a < iterations; a++) {
13  if (Mode == LazyEval) {
14  asm("#begin_bench_loop LazyEval");
15  if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
16  m = (I + 0.00005 * (m + m.lazyProduct(m))).eval();
17  } else if (Mode == OmpEval) {
18  asm("#begin_bench_loop OmpEval");
19  if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
20  m = (I + 0.00005 * (m + m.lazyProduct(m))).eval();
21  } else {
22  asm("#begin_bench_loop EarlyEval");
23  if (MatrixType::SizeAtCompileTime != Eigen::Dynamic) asm("#fixedsize");
24  m = I + 0.00005 * (m + m * m);
25  }
26  asm("#end_bench_loop");
27  }
28 }
const Scalar * a
Definition: level2_cplx_impl.h:32
const int Dynamic
Definition: Constants.h:25

References a, Eigen::Dynamic, I, LazyEval, m, and OmpEval.