TR-mbed 1.0
Loading...
Searching...
No Matches
mixed_perf_analyzer.hh
Go to the documentation of this file.
1//=====================================================
2// File : mixed_perf_analyzer.hh
3// Author : L. Plagne <laurent.plagne@edf.fr)>
4// Copyright (C) EDF R&D, mar déc 3 18:59:36 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 _MIXED_PERF_ANALYSER_HH
21#define _MIXED_PERF_ANALYSER_HH
22
23#include "x86_perf_analyzer.hh"
25
26// choose portable perf analyzer for long calculations and x86 analyser for short ones
27
28
29template<class Action>
31
32public:
33 Mixed_Perf_Analyzer( void ):_x86pa(),_ppa(),_use_ppa(true)
34 {
35 MESSAGE("Mixed_Perf_Analyzer Ctor");
36 };
38 INFOS("Copy Ctor not implemented");
39 exit(0);
40 };
42 MESSAGE("Mixed_Perf_Analyzer Dtor");
43 };
44
45
46 inline double eval_mflops(int size)
47 {
48
49 double result=0.0;
50 if (_use_ppa){
51 result=_ppa.eval_mflops(size);
52 if (_ppa.get_nb_calc()>DEFAULT_NB_SAMPLE){_use_ppa=false;}
53 }
54 else{
55 result=_x86pa.eval_mflops(size);
56 }
57
58 return result;
59 }
60
61private:
62
65 bool _use_ppa;
66
67};
68
69#endif
70
71
72
73
Scalar Scalar int size
Definition benchVecAdd.cpp:17
#define DEFAULT_NB_SAMPLE
Definition bench_parameter.hh:48
Definition mixed_perf_analyzer.hh:30
double eval_mflops(int size)
Definition mixed_perf_analyzer.hh:46
Mixed_Perf_Analyzer(void)
Definition mixed_perf_analyzer.hh:33
Mixed_Perf_Analyzer(const Mixed_Perf_Analyzer &)
Definition mixed_perf_analyzer.hh:37
~Mixed_Perf_Analyzer(void)
Definition mixed_perf_analyzer.hh:41
Definition portable_perf_analyzer.hh:28
Definition x86_perf_analyzer.hh:27
double eval_mflops(int size)
Definition x86_perf_analyzer.hh:43
#define INFOS(chain)
Definition utilities.h:22
#define MESSAGE(chain)
Definition utilities.h:76