summaryrefslogtreecommitdiffhomepage
path: root/eigen/bench/basicbenchmark.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-18 12:42:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-11-02 15:12:04 +0100
commit44861dcbfeee041223c4aac1ee075e92fa4daa01 (patch)
tree6dfdfd9637846a7aedd71ace97d7d2ad366496d7 /eigen/bench/basicbenchmark.cpp
parentf3fe458b9e0a29a99a39d47d9a76dc18964b6fec (diff)
update
Diffstat (limited to 'eigen/bench/basicbenchmark.cpp')
-rw-r--r--eigen/bench/basicbenchmark.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/eigen/bench/basicbenchmark.cpp b/eigen/bench/basicbenchmark.cpp
new file mode 100644
index 0000000..a26ea85
--- /dev/null
+++ b/eigen/bench/basicbenchmark.cpp
@@ -0,0 +1,35 @@
+
+#include <iostream>
+#include "BenchUtil.h"
+#include "basicbenchmark.h"
+
+int main(int argc, char *argv[])
+{
+ DISABLE_SSE_EXCEPTIONS();
+
+ // this is the list of matrix type and size we want to bench:
+ // ((suffix) (matrix size) (number of iterations))
+ #define MODES ((3d)(3)(4000000)) ((4d)(4)(1000000)) ((Xd)(4)(1000000)) ((Xd)(20)(10000))
+// #define MODES ((Xd)(20)(10000))
+
+ #define _GENERATE_HEADER(R,ARG,EL) << 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)) << " / "
+
+ std::cout BOOST_PP_SEQ_FOR_EACH(_GENERATE_HEADER, ~, MODES ) << endl;
+
+ const int tries = 10;
+
+ #define _RUN_BENCH(R,ARG,EL) \
+ 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) \
+ << " ";
+
+ BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<LazyEval>, MODES );
+ std::cout << endl;
+ BOOST_PP_SEQ_FOR_EACH(_RUN_BENCH, benchBasic<EarlyEval>, MODES );
+ std::cout << endl;
+
+ return 0;
+}