FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
RuntimeMeasurementManager.hpp
Go to the documentation of this file.
1 #ifndef RUNTIMEMEASUREMENTMANAGER_HPP_
2 #define RUNTIMEMEASUREMENTMANAGER_HPP_
3 
4 #include <string>
5 #include <map>
6 #include "CL/OpenCL.hpp"
7 #include "RuntimeMeasurement.hpp"
8 #include <chrono>
9 #include <memory>
10 
11 
12 namespace fast {
13 
14 class FAST_EXPORT RuntimeMeasurementsManager : public Object {
16 public:
17  void enable();
18  void disable();
19  bool isEnabled();
20 
21  void startCLTimer(std::string name, cl::CommandQueue queue);
22  void stopCLTimer(std::string name, cl::CommandQueue queue);
23 
24  void startRegularTimer(std::string name);
25  void stopRegularTimer(std::string name);
26 
27  void startNumberedCLTimer(std::string name, cl::CommandQueue queue);
28  void stopNumberedCLTimer(std::string name, cl::CommandQueue queue);
29 
30  void startNumberedRegularTimer(std::string name);
31  void stopNumberedRegularTimer(std::string name);
32 
33  RuntimeMeasurement::pointer getTiming(std::string name);
34 
35  void print(std::string name);
36  void printAll();
37 
38 private:
40  bool enabled;
41  std::map<std::string, RuntimeMeasurement::pointer> timings;
42  std::map<std::string, unsigned int> numberings;
43  std::map<std::string, cl::Event> startEvents;
44  std::map<std::string, std::chrono::system_clock::time_point> startTimes;
45 };
46 
47 } //namespace fast
48 
49 #endif /* RUNTIMEMEASUREMENTMANAGER_HPP_ */
fast
Definition: AffineTransformation.hpp:7
fast::Object
Definition: Object.hpp:34
FAST_OBJECT
#define FAST_OBJECT(className)
Definition: Object.hpp:9
fast::RuntimeMeasurement::pointer
std::shared_ptr< RuntimeMeasurement > pointer
Definition: RuntimeMeasurement.hpp:14
RuntimeMeasurement.hpp
fast::RuntimeMeasurementsManager
Definition: RuntimeMeasurementManager.hpp:14