You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

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