OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
IplCounter.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef IPL_COUNTER_H
12 #define IPL_COUNTER_H
13 
14 /***************************************************************************
15  * IplCounter - a simple megaflops counter that accesses hardware counters
16  * for measureing megaflop performance.
17  *
18  * To use these counters:
19  * 1. Create a counter.
20  * example: Counter FFTcounter("FFT");
21  *
22  * 2. Locate the function which you would like to measure and start the
23  * counter by placing the startCounter() method before it. Then, stop
24  * the counter after it by using the stopCounter() method.
25  * example: FFTcounter.startCounter();
26  * fft->transform(....);
27  * FFTcounter.stopCounter();
28  *
29  * 3. Use the printIt() method to print to the screen.
30  * example: FFTcounter.printIt();
31  *
32  ***************************************************************************/
33 
34 // include files
35 #include "Utility/Inform.h"
36 #include
37 
38 
40 {
41 public:
42  // constructor
43  IplCounter(const char *category);
44 
45  // destructor
46  ~IplCounter();
47 
48  // counter operations
49  void startCounter();
50  void stopCounter();
51  void printIt();
52 
53 private:
54  typedef long long CounterLong;
55 
60 
61  int e0_m;
62  int e1_m;
65 
66  std::string category_m;
68 };
69 
70 #endif
71 
72 /***************************************************************************
73  * $RCSfile: IplCounter.h,v $ $Author: adelmann $
74  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
75  ***************************************************************************/
76 
77 /***************************************************************************
78  * $RCSfile: addheaderfooter,v $ $Author: adelmann $
79  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:17 $
80  * IPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $
81  ***************************************************************************/
82 
void printIt()
IplCounter(const char *category)
CounterLong c21_m
Definition: IplCounter.h:59
int gen_read_m
Definition: IplCounter.h:64
Inform msg_m
Definition: IplCounter.h:67
void stopCounter()
CounterLong totalinst_m
Definition: IplCounter.h:57
std::string category_m
Definition: IplCounter.h:66
long long CounterLong
Definition: IplCounter.h:54
void startCounter()
int gen_start_m
Definition: IplCounter.h:63
CounterLong totalcyc_m
Definition: IplCounter.h:56
Definition: Inform.h:41
CounterLong c0_m
Definition: IplCounter.h:58