From 783eb6da9b7a31d856fd13958560a6fbe73332b4 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 8 Jul 2008 17:25:58 +0000 Subject: [PATCH] I forgot that the previous commit needed minor changes outside the bench folder --- Eigen/src/QR/EigenSolver.h | 4 +- disabled/ompbench.cxxlist | 7 ++++ disabled/ompbenchmark.cpp | 81 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 disabled/ompbench.cxxlist create mode 100644 disabled/ompbenchmark.cpp diff --git a/Eigen/src/QR/EigenSolver.h b/Eigen/src/QR/EigenSolver.h index ac4ad9147..6beba231e 100644 --- a/Eigen/src/QR/EigenSolver.h +++ b/Eigen/src/QR/EigenSolver.h @@ -60,10 +60,10 @@ template class EigenSolver EigenvalueType eigenvalues(void) const { return m_eivalues; } - private: - void compute(const MatrixType& matrix); + private: + void orthes(MatrixType& matH, RealVectorType& ort); void hqr2(MatrixType& matH); diff --git a/disabled/ompbench.cxxlist b/disabled/ompbench.cxxlist new file mode 100644 index 000000000..fc6681d33 --- /dev/null +++ b/disabled/ompbench.cxxlist @@ -0,0 +1,7 @@ +#!/bin/bash + +CLIST[((g++))]="g++-4.2 -O3 -DNDEBUG -finline-limit=10000 -fopenmp" + +# CLIST[((g++))]="g++-4.3 -O3 -DNDEBUG -finline-limit=10000 -fopenmp" + +CLIST[((g++))]="icpc -fast -DNDEBUG -fno-exceptions -no-inline-max-size -openmp" \ No newline at end of file diff --git a/disabled/ompbenchmark.cpp b/disabled/ompbenchmark.cpp new file mode 100644 index 000000000..ac5155cb8 --- /dev/null +++ b/disabled/ompbenchmark.cpp @@ -0,0 +1,81 @@ +// g++ -O3 -DNDEBUG -I.. -fopenmp benchOpenMP.cpp -o benchOpenMP && ./benchOpenMP 2> /dev/null +// icpc -fast -fno-exceptions -DNDEBUG -I.. -openmp benchOpenMP.cpp -o benchOpenMP && ./benchOpenMP 2> /dev/null + +#include +#include "BenchUtil.h" +#include "basicbenchmark.h" + +// #include +// #include "BenchTimer.h" +// +// using namespace std; +// USING_PART_OF_NAMESPACE_EIGEN +// +// enum {LazyEval, EarlyEval, OmpEval}; +// +// template +// double benchSingleProc(const MatrixType& mat, int iterations, int tries) __attribute__((noinline)); +// +// template +// double benchBasic(const MatrixType& mat, int iterations, int tries) +// { +// const int rows = mat.rows(); +// const int cols = mat.cols(); +// +// Eigen::BenchTimer timer; +// for(uint t=0; t(Matrix4d(), 10000, 10) << "s " + << benchBasic(Matrix4d(), 10000, 10) << "s \n"; + + #define BENCH_MATRIX(TYPE, SIZE, ITERATIONS, TRIES) {\ + double single = benchBasic(Matrix(SIZE,SIZE), ITERATIONS, TRIES); \ + double omp = benchBasic (Matrix(SIZE,SIZE), ITERATIONS, TRIES); \ + std::cout << #TYPE << ", " << #SIZE << "x" << #SIZE << ": " << single << "s " << omp << "s " \ + << " => x" << single/omp << " (" << omp_get_num_procs() << ")" << std::endl; \ + } + + BENCH_MATRIX(double, 32, 1000, 10); + BENCH_MATRIX(double, 128, 10, 10); + BENCH_MATRIX(double, 512, 1, 6); + BENCH_MATRIX(double, 1024, 1, 4); + + return 0; +} +