aboutsummaryrefslogtreecommitdiff
path: root/bench/btl/generic_bench/static/bench_static.hh
blob: 23b55ecff53ca2616eedbac276ff5818ee4de5a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//=====================================================
// File   :  bench_static.hh
// Author :  L. Plagne <laurent.plagne@edf.fr)>
// Copyright (C) EDF R&D,  lun sep 30 14:23:16 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
// GNU General Public License for more details.
// 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.
//
#ifndef BENCH_STATIC_HH
#define BENCH_STATIC_HH

#include "btl.hh"
#include "bench_parameter.hh"
#include <iostream>
#include "utilities.h"
#include "xy_file.hh"
#include "static/static_size_generator.hh"
#include "timers/portable_perf_analyzer.hh"
// #include "timers/mixed_perf_analyzer.hh"
// #include "timers/x86_perf_analyzer.hh"

using namespace std;


template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface>
BTL_DONT_INLINE  void bench_static(void)
{
  if (BtlConfig::skipAction(Action<Interface<REAL_TYPE,10> >::name()))
    return;

  string filename = "bench_" + Action<Interface<REAL_TYPE,10> >::name() + ".dat";

  INFOS("starting " << filename);

  const int max_size = TINY_MV_MAX_SIZE;

  std::vector<double> tab_mflops;
  std::vector<double> tab_sizes;

  static_size_generator<max_size,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops);

  dump_xy_file(tab_sizes,tab_mflops,filename);
}

// default Perf Analyzer
template <template<class> class Action, template<class,int> class Interface>
BTL_DONT_INLINE  void bench_static(void)
{
  bench_static<Portable_Perf_Analyzer,Action,Interface>();
  //bench_static<Mixed_Perf_Analyzer,Action,Interface>();
  //bench_static<X86_Perf_Analyzer,Action,Interface>();
}

#endif