From 68eaefa5d4966d0130c64643b0554f05cec1ecf8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 23 Feb 2010 18:23:12 +0100 Subject: update BTL (better timer, eigen2 => eigen3, etc) --- bench/btl/CMakeLists.txt | 2 +- bench/btl/data/perlib_plot_settings.txt | 6 +- bench/btl/generic_bench/bench_parameter.hh | 4 +- .../generic_bench/timers/portable_perf_analyzer.hh | 29 ++++----- bench/btl/generic_bench/timers/portable_timer.hh | 60 ++++++++++-------- bench/btl/libs/eigen2/CMakeLists.txt | 72 +++++++++++----------- 6 files changed, 90 insertions(+), 83 deletions(-) (limited to 'bench/btl') diff --git a/bench/btl/CMakeLists.txt b/bench/btl/CMakeLists.txt index af234624a..5855c0d9e 100644 --- a/bench/btl/CMakeLists.txt +++ b/bench/btl/CMakeLists.txt @@ -70,7 +70,7 @@ MACRO(BTL_ADD_BENCH targetname) IF(BUILD_${targetname}) ADD_EXECUTABLE(${targetname} ${_sources}) ADD_TEST(${targetname} "${targetname}") - target_link_libraries(${targetname} ${DEFAULT_LIBRARIES}) + target_link_libraries(${targetname} ${DEFAULT_LIBRARIES} rt) ENDIF(BUILD_${targetname}) ENDMACRO(BTL_ADD_BENCH) diff --git a/bench/btl/data/perlib_plot_settings.txt b/bench/btl/data/perlib_plot_settings.txt index d45f4ff98..4c253f450 100644 --- a/bench/btl/data/perlib_plot_settings.txt +++ b/bench/btl/data/perlib_plot_settings.txt @@ -1,6 +1,6 @@ -eigen2 ; with lines lw 4 lt 1 lc rgbcolor "black" -eigen2_novec ; with lines lw 2 lt 1 lc rgbcolor "#999999" -eigen2_nogccvec ; with lines lw 2 lt 2 lc rgbcolor "#991010" +eigen3 ; with lines lw 4 lt 1 lc rgbcolor "black" +eigen3_novec ; with lines lw 2 lt 1 lc rgbcolor "#999999" +eigen3_nogccvec ; with lines lw 2 lt 2 lc rgbcolor "#991010" INTEL_MKL ; with lines lw 3 lt 2 lc rgbcolor "#00b7ff" ATLAS ; with lines lw 3 lt 1 lc rgbcolor "#52e657" gmm ; with lines lw 3 lt 1 lc rgbcolor "#0000ff" diff --git a/bench/btl/generic_bench/bench_parameter.hh b/bench/btl/generic_bench/bench_parameter.hh index e9603e4fc..d14340037 100644 --- a/bench/btl/generic_bench/bench_parameter.hh +++ b/bench/btl/generic_bench/bench_parameter.hh @@ -23,7 +23,7 @@ // minimal time for each measurement #define REAL_TYPE float // minimal time for each measurement -#define MIN_TIME 0.5 +#define MIN_TIME 0.2 // nb of point on bench curves #define NB_POINT 100 // min vector size for axpy bench @@ -48,6 +48,6 @@ #define DEFAULT_NB_SAMPLE 1000 // how many times we run a single bench (keep the best perf) -#define NB_TRIES 5 +#define NB_TRIES 3 #endif diff --git a/bench/btl/generic_bench/timers/portable_perf_analyzer.hh b/bench/btl/generic_bench/timers/portable_perf_analyzer.hh index 4298e61df..6b1f8e7d7 100644 --- a/bench/btl/generic_bench/timers/portable_perf_analyzer.hh +++ b/bench/btl/generic_bench/timers/portable_perf_analyzer.hh @@ -27,41 +27,41 @@ template class Portable_Perf_Analyzer{ public: - Portable_Perf_Analyzer( void ):_nb_calc(1),_chronos(){ + Portable_Perf_Analyzer( ):_nb_calc(0), m_time_action(0), _chronos(){ MESSAGE("Portable_Perf_Analyzer Ctor"); }; Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){ INFOS("Copy Ctor not implemented"); exit(0); }; - ~Portable_Perf_Analyzer( void ){ + ~Portable_Perf_Analyzer(){ MESSAGE("Portable_Perf_Analyzer Dtor"); }; - BTL_DONT_INLINE double eval_mflops(int size) + BTL_DONT_INLINE double eval_mflops(int size) { Action action(size); - double time_action = 0; - action.initialize(); - time_action = time_calculate(action); - while (time_action < MIN_TIME) +// action.initialize(); +// time_action = time_calculate(action); + while (m_time_action < MIN_TIME) { - _nb_calc *= 2; + if(_nb_calc==0) _nb_calc = 1; + else _nb_calc *= 2; action.initialize(); - time_action = time_calculate(action); + m_time_action = time_calculate(action); } // optimize for (int i=1; i