From 6f71ef8277405d268032f7c3bcaf316c7422c133 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 10 Jul 2008 18:28:50 +0000 Subject: resurrected tvmet, added mt4, intel's MKL and handcoded vectorized backends in the benchmark suite --- bench/btl/generic_bench/btl.hh | 2 + bench/btl/generic_bench/timers/portable_timer.hh | 52 +++++++++++++----------- 2 files changed, 30 insertions(+), 24 deletions(-) (limited to 'bench/btl/generic_bench') diff --git a/bench/btl/generic_bench/btl.hh b/bench/btl/generic_bench/btl.hh index 97b0dec7c..5b561b676 100644 --- a/bench/btl/generic_bench/btl.hh +++ b/bench/btl/generic_bench/btl.hh @@ -18,8 +18,10 @@ // #ifndef BTL_HH #define BTL_HH + #include "bench_parameter.hh" #include +#include #include #include #include "utilities.h" diff --git a/bench/btl/generic_bench/timers/portable_timer.hh b/bench/btl/generic_bench/timers/portable_timer.hh index 3b7c5266b..7d4059464 100755 --- a/bench/btl/generic_bench/timers/portable_timer.hh +++ b/bench/btl/generic_bench/timers/portable_timer.hh @@ -3,12 +3,12 @@ // Author : L. Plagne from boost lib // Copyright (C) EDF R&D, lun sep 30 14:23:17 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,18 +16,22 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// // simple_time extracted from the boost library -// +// #ifndef _PORTABLE_TIMER_HH #define _PORTABLE_TIMER_HH +#include +#include + #include #include #include #include #include + #define USEC_IN_SEC 1000000 @@ -45,37 +49,37 @@ class Portable_Timer _utime_usec_stop(-1) { } - - void start() - { - + + void start() + { + int status=getrusage(RUSAGE_SELF, &resourcesUsage) ; - - _start_time = std::clock(); + + _start_time = std::clock(); _utime_sec_start = resourcesUsage.ru_utime.tv_sec ; _utime_usec_start = resourcesUsage.ru_utime.tv_usec ; } - - void stop() - { - + + void stop() + { + int status=getrusage(RUSAGE_SELF, &resourcesUsage) ; - - _stop_time = std::clock(); - + + _stop_time = std::clock(); + _utime_sec_stop = resourcesUsage.ru_utime.tv_sec ; _utime_usec_stop = resourcesUsage.ru_utime.tv_usec ; - + } double elapsed() { - return double(_stop_time - _start_time) / CLOCKS_PER_SEC; + return double(_stop_time - _start_time) / CLOCKS_PER_SEC; } - + double user_time() { long tot_utime_sec=_utime_sec_stop-_utime_sec_start; @@ -83,17 +87,17 @@ class Portable_Timer return double(tot_utime_sec)+ double(tot_utime_usec)/double(USEC_IN_SEC) ; } - + private: struct rusage resourcesUsage ; - + long _utime_sec_start ; long _utime_usec_start ; - + long _utime_sec_stop ; long _utime_usec_stop ; - + std::clock_t _start_time; std::clock_t _stop_time; -- cgit v1.2.3