basicbenchmark.cpp File Reference
#include <iostream>
#include "BenchUtil.h"
#include "basicbenchmark.h"

Macros

#define MODES   ((3d)(3)(4000000))((4d)(4)(1000000))((Xd)(4)(1000000))((Xd)(20)(10000))
 
#define _GENERATE_HEADER(R, ARG, EL)
 
#define _RUN_BENCH(R, ARG, EL)
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ _GENERATE_HEADER

#define _GENERATE_HEADER (   R,
  ARG,
  EL 
)
Value:
<< BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) \
<< "-" \
<< BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "x" << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << " / "

◆ _RUN_BENCH

#define _RUN_BENCH (   R,
  ARG,
  EL 
)
Value:
std::cout << ARG(BOOST_PP_CAT(Matrix, BOOST_PP_SEQ_HEAD(EL))(BOOST_PP_SEQ_ELEM(1, EL), BOOST_PP_SEQ_ELEM(1, EL)), \
BOOST_PP_SEQ_ELEM(2, EL), tries) \
<< " ";
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186

◆ MODES

#define MODES   ((3d)(3)(4000000))((4d)(4)(1000000))((Xd)(4)(1000000))((Xd)(20)(10000))

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
6  {
8 
9 // this is the list of matrix type and size we want to bench:
10 // ((suffix) (matrix size) (number of iterations))
11 #define MODES ((3d)(3)(4000000))((4d)(4)(1000000))((Xd)(4)(1000000))((Xd)(20)(10000))
12  // #define MODES ((Xd)(20)(10000))
13 
14 #define _GENERATE_HEADER(R, ARG, EL) \
15  << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) \
16  << "-" \
17  << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "x" << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << " / "
18 
19  std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER, ~, MODES) << endl;
20 
21  const int tries = 10;
22 
23 #define _RUN_BENCH(R, ARG, EL) \
24  std::cout << ARG(BOOST_PP_CAT(Matrix, BOOST_PP_SEQ_HEAD(EL))(BOOST_PP_SEQ_ELEM(1, EL), BOOST_PP_SEQ_ELEM(1, EL)), \
25  BOOST_PP_SEQ_ELEM(2, EL), tries) \
26  << " ";
27 
28  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<LazyEval>, MODES);
29  std::cout << endl;
30  BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<EarlyEval>, MODES);
31  std::cout << endl;
32 
33  return 0;
34 }
#define DISABLE_SSE_EXCEPTIONS()
Definition: BenchUtil.h:36
#define _GENERATE_HEADER(R, ARG, EL)
#define MODES
#define _RUN_BENCH(R, ARG, EL)

References _GENERATE_HEADER, _RUN_BENCH, DISABLE_SSE_EXCEPTIONS, and MODES.