Chisel
Profiler.h
Go to the documentation of this file.
1 #ifndef PROFILER_H
2 #define PROFILER_H
3 
4 #include "llvm/Support/Timer.h"
5 
7 class Profiler {
8 public:
9  static void Initialize();
10  static Profiler *GetInstance();
11  static void Finalize();
12 
17 
18  int getGlobalReductionCounter() { return GlobalReductionCounter; }
20  return SuccessfulGlobalReductionCounter;
21  }
22  int getLocalReductionCounter() { return LocalReductionCounter; }
24  return SuccessfulLocalReductionCounter;
25  }
26 
27  llvm::Timer &getChiselTimer() { return ChiselTimer; }
28  llvm::Timer &getLearningTimer() { return LearningTimer; }
29  llvm::Timer &getOracleTimer() { return OracleTimer; }
30 
31  llvm::TimeRecord &getChiselTimeRecord() { return ChiselTimeRecord; }
32  llvm::TimeRecord &getLearningTimeRecord() { return LearningTimeRecord; }
33  llvm::TimeRecord &getOracleTimeRecord() { return OracleTimeRecord; }
34 
35  void beginChisel();
36  void endChisel();
37 
38  void beginOracle();
39  void endOracle();
40 
41  void beginLearning();
42  void endLearning();
43 
44 private:
45  Profiler() {}
46  ~Profiler() {}
47 
48  static Profiler *Instance;
49 
50  int GlobalReductionCounter = 0;
51  int SuccessfulGlobalReductionCounter = 0;
52  int LocalReductionCounter = 0;
53  int SuccessfulLocalReductionCounter = 0;
54 
55  llvm::TimeRecord ChiselTimeRecord;
56  llvm::TimeRecord LearningTimeRecord;
57  llvm::TimeRecord OracleTimeRecord;
58 
59  llvm::Timer ChiselTimer;
60  llvm::Timer LearningTimer;
61  llvm::Timer OracleTimer;
62 };
63 
64 #endif // PROFILER_H
int getSuccessfulLocalReductionCounter()
Definition: Profiler.h:23
llvm::TimeRecord & getOracleTimeRecord()
Definition: Profiler.h:33
static Profiler * GetInstance()
Definition: Profiler.cpp:15
llvm::Timer & getLearningTimer()
Definition: Profiler.h:28
void beginChisel()
Definition: Profiler.cpp:35
int getLocalReductionCounter()
Definition: Profiler.h:22
void incrementSuccessfulGlobalReductionCounter()
Definition: Profiler.cpp:25
int getGlobalReductionCounter()
Definition: Profiler.h:18
void incrementLocalReductionCounter()
Definition: Profiler.cpp:29
static void Finalize()
Definition: Profiler.cpp:21
llvm::TimeRecord & getChiselTimeRecord()
Definition: Profiler.h:31
llvm::Timer & getOracleTimer()
Definition: Profiler.h:29
void endChisel()
Definition: Profiler.cpp:40
void endLearning()
Definition: Profiler.cpp:64
void beginOracle()
Definition: Profiler.cpp:47
llvm::TimeRecord & getLearningTimeRecord()
Definition: Profiler.h:32
void endOracle()
Definition: Profiler.cpp:52
static void Initialize()
Definition: Profiler.cpp:7
int getSuccessfulGlobalReductionCounter()
Definition: Profiler.h:19
void incrementSuccessfulLocalReductionCounter()
Definition: Profiler.cpp:31
void beginLearning()
Definition: Profiler.cpp:59
void incrementGlobalReductionCounter()
Definition: Profiler.cpp:23
llvm::Timer & getChiselTimer()
Definition: Profiler.h:27
Keeps track of performance information that is used in preparing the report.
Definition: Profiler.h:7