basicbenchmark.cpp
Go to the documentation of this file.
00001 
00002 #include <iostream>
00003 #include "BenchUtil.h"
00004 #include "basicbenchmark.h"
00005 
00006 int main(int argc, char *argv[])
00007 {
00008   DISABLE_SSE_EXCEPTIONS();
00009 
00010   // this is the list of matrix type and size we want to bench:
00011   // ((suffix) (matrix size) (number of iterations))
00012   #define MODES ((3d)(3)(4000000)) ((4d)(4)(1000000)) ((Xd)(4)(1000000)) ((Xd)(20)(10000))
00013 //   #define MODES ((Xd)(20)(10000))
00014 
00015   #define _GENERATE_HEADER(R,ARG,EL) << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_HEAD(EL)) << "-" \
00016     << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "x" \
00017     << BOOST_PP_STRINGIZE(BOOST_PP_SEQ_ELEM(1,EL)) << "   /   "
00018 
00019   std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER, ~, MODES ) << endl;
00020 
00021   const int tries = 10;
00022 
00023   #define _RUN_BENCH(R,ARG,EL) \
00024     std::cout << ARG( \
00025       BOOST_PP_CAT(Matrix, BOOST_PP_SEQ_HEAD(EL)) (\
00026          BOOST_PP_SEQ_ELEM(1,EL),BOOST_PP_SEQ_ELEM(1,EL)), BOOST_PP_SEQ_ELEM(2,EL), tries) \
00027     << "   ";
00028 
00029   BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<LazyEval>, MODES );
00030   std::cout << endl;
00031   BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<EarlyEval>, MODES );
00032   std::cout << endl;
00033 
00034   return 0;
00035 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:30:47