OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
IpplCounter.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef IPPL_COUNTER_H
12 #define IPPL_COUNTER_H
13 
14 /***************************************************************************
15  * IpplCounter - 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 
38 {
39 public:
40  // constructor
41  IpplCounter(const char *category);
42 
43  // destructor
44  ~IpplCounter();
45 
46  // counter operations
47  void startCounter();
48  void stopCounter();
49  void printIt();
50 
51 private:
52  typedef long long CounterLong;
53 
58 
59 #ifdef SGI_HW_COUNTERS
60  int e0_m;
61  int e1_m;
62 #endif
65 
66  std::string category_m;
68 };
69 
70 #endif
71 
72 /***************************************************************************
73  * $RCSfile: IpplCounter.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  * IPPL_VERSION_ID: $Id: addheaderfooter,v 1.1.1.1 2003/01/23 07:40:17 adelmann Exp $
81  ***************************************************************************/
void stopCounter()
Definition: IpplCounter.cpp:69
int gen_read_m
Definition: IpplCounter.h:64
long long CounterLong
Definition: IpplCounter.h:52
std::string category_m
Definition: IpplCounter.h:66
int gen_start_m
Definition: IpplCounter.h:63
CounterLong totalinst_m
Definition: IpplCounter.h:55
void printIt()
Definition: IpplCounter.cpp:86
void startCounter()
Definition: IpplCounter.cpp:59
CounterLong totalcyc_m
Definition: IpplCounter.h:54
CounterLong c0_m
Definition: IpplCounter.h:56
Inform msg_m
Definition: IpplCounter.h:67
CounterLong c21_m
Definition: IpplCounter.h:57
Definition: Inform.h:41
IpplCounter(const char *category)
Definition: IpplCounter.cpp:41