gtsam
3rdparty
Eigen
bench
btl
generic_bench
timers
STL_perf_analyzer.hh
Go to the documentation of this file.
1
//=====================================================
2
// File : STL_perf_analyzer.hh
3
// Author : L. Plagne <laurent.plagne@edf.fr)>
4
// Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002
5
//=====================================================
6
//
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public License
9
// as published by the Free Software Foundation; either version 2
10
// of the License, or (at your option) any later version.
11
//
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with this program; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
//
20
#ifndef _STL_PERF_ANALYSER_HH
21
#define _STL_PERF_ANALYSER_HH
22
23
#include "
STL_timer.hh
"
24
#include "
bench_parameter.hh
"
25
26
template
<
class
ACTION>
27
class
STL_Perf_Analyzer
{
28
public
:
29
STL_Perf_Analyzer
(
unsigned
long
long
nb_sample=
DEFAULT_NB_SAMPLE
):
_nb_sample
(nb_sample),
_chronos
()
30
{
31
MESSAGE
(
"STL_Perf_Analyzer Ctor"
);
32
};
33
STL_Perf_Analyzer
(
const
STL_Perf_Analyzer
& ){
34
INFOS
(
"Copy Ctor not implemented"
);
35
exit(0);
36
};
37
~STL_Perf_Analyzer
(
void
){
38
MESSAGE
(
"STL_Perf_Analyzer Dtor"
);
39
};
40
41
42
inline
double
eval_mflops
(
int
size
)
43
{
44
45
ACTION
action
(
size
);
46
47
_chronos
.
start_baseline
(
_nb_sample
);
48
49
do
{
50
51
action
.initialize();
52
}
while
(
_chronos
.
check
());
53
54
double
baseline_time=
_chronos
.
get_time
();
55
56
_chronos
.
start
(
_nb_sample
);
57
do
{
58
action
.initialize();
59
action
.calculate();
60
}
while
(
_chronos
.
check
());
61
62
double
calculate_time=
_chronos
.
get_time
();
63
64
double
corrected_time=calculate_time-baseline_time;
65
66
// cout << size <<" "<<baseline_time<<" "<<calculate_time<<" "<<corrected_time<<" "<<action.nb_op_base() << endl;
67
68
return
action
.nb_op_base()/(corrected_time*1000000.0);
69
//return action.nb_op_base()/(calculate_time*1000000.0);
70
71
}
72
private
:
73
74
STL_Timer
_chronos
;
75
unsigned
long
long
_nb_sample
;
76
77
78
};
79
80
81
82
#endif
STL_Perf_Analyzer::eval_mflops
double eval_mflops(int size)
Definition:
STL_perf_analyzer.hh:42
STL_Timer::check
bool check()
Definition:
STL_timer.hh:48
STL_Perf_Analyzer::_chronos
STL_Timer _chronos
Definition:
STL_perf_analyzer.hh:74
STL_Perf_Analyzer::_nb_sample
unsigned long long _nb_sample
Definition:
STL_perf_analyzer.hh:75
size
Scalar Scalar int size
Definition:
benchVecAdd.cpp:17
MESSAGE
#define MESSAGE(chain)
Definition:
3rdparty/Eigen/bench/btl/generic_bench/utils/utilities.h:76
gtsam.examples.DogLegOptimizerExample.action
action
Definition:
DogLegOptimizerExample.py:115
STL_Timer::start
void start(unsigned int r)
Definition:
STL_timer.hh:34
bench_parameter.hh
INFOS
#define INFOS(chain)
Definition:
3rdparty/Eigen/bench/btl/generic_bench/utils/utilities.h:22
STL_timer.hh
DEFAULT_NB_SAMPLE
#define DEFAULT_NB_SAMPLE
Definition:
bench_parameter.hh:48
STL_Timer::get_time
double get_time(void)
Definition:
STL_timer.hh:60
STL_Timer
Definition:
STL_timer.hh:30
STL_Perf_Analyzer
Definition:
STL_perf_analyzer.hh:27
STL_Perf_Analyzer::~STL_Perf_Analyzer
~STL_Perf_Analyzer(void)
Definition:
STL_perf_analyzer.hh:37
STL_Timer::start_baseline
void start_baseline(unsigned int r)
Definition:
STL_timer.hh:42
STL_Perf_Analyzer::STL_Perf_Analyzer
STL_Perf_Analyzer(unsigned long long nb_sample=DEFAULT_NB_SAMPLE)
Definition:
STL_perf_analyzer.hh:29
STL_Perf_Analyzer::STL_Perf_Analyzer
STL_Perf_Analyzer(const STL_Perf_Analyzer &)
Definition:
STL_perf_analyzer.hh:33
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:05:00