GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSProfilerItem.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_TOOLS_GGEMSPROFILERITEM_HH
2 #define GUARD_GGEMS_TOOLS_GGEMSPROFILERITEM_HH
3 
4 // ************************************************************************
5 // * This file is part of GGEMS. *
6 // * *
7 // * GGEMS is free software: you can redistribute it and/or modify *
8 // * it under the terms of the GNU General Public License as published by *
9 // * the Free Software Foundation, either version 3 of the License, or *
10 // * (at your option) any later version. *
11 // * *
12 // * GGEMS is distributed in the hope that it will be useful, *
13 // * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 // * GNU General Public License for more details. *
16 // * *
17 // * You should have received a copy of the GNU General Public License *
18 // * along with GGEMS. If not, see <https://www.gnu.org/licenses/>. *
19 // * *
20 // ************************************************************************
21 
36 
42 {
43  START = 0,
44  END,
45  ELAPSED
46 };
47 
52 class GGEMS_EXPORT GGEMSProfilerItem
53 {
54  public:
59  explicit GGEMSProfilerItem(cl_event event);
60 
65 
71  GGEMSProfilerItem(GGEMSProfilerItem const& profiler_item) = delete;
72 
78  GGEMSProfilerItem& operator=(GGEMSProfilerItem const& profiler_item) = delete;
79 
85  GGEMSProfilerItem(GGEMSProfilerItem const&& profiler_item) = delete;
86 
92  GGEMSProfilerItem& operator=(GGEMSProfilerItem const&& profiler_item) = delete;
93 
99  inline DurationNano GetElapsedTime(void) const {return static_cast<DurationNano>(times_[GGEMSEventInfo::ELAPSED]);}
100 
106  void UpdateEvent(cl_event event);
107 
108  private:
109  GGulong times_[3];
110 };
111 
112 #endif // End of GUARD_GGEMS_TOOLS_GGEMSPROFILERITEM_HH
GGulong
#define GGulong
Definition: GGEMSTypes.hh:245
GGEMSProfilerItem::GetElapsedTime
DurationNano GetElapsedTime(void) const
Get elapsed time.
Definition: GGEMSProfilerItem.hh:99
GGEMSProfilerItem::GGEMSProfilerItem
GGEMSProfilerItem(GGEMSProfilerItem const &&profiler_item)=delete
Avoid copy by rvalue reference.
DurationNano
std::chrono::duration< int64_t, std::nano > DurationNano
Definition: GGEMSChrono.hh:40
GGint
#define GGint
Definition: GGEMSTypes.hh:224
GGEMSChrono.hh
Namespace computing/displaying the time.
GGEMSProfilerItem
GGEMS handling a specific item profiler_item.
Definition: GGEMSProfilerItem.hh:53
GGEMSTypes.hh
Redefining types for OpenCL device and host.
GGEMSProfilerItem::operator=
GGEMSProfilerItem & operator=(GGEMSProfilerItem const &profiler_item)=delete
Avoid assignement by reference.
GGEMSEventInfo
GGEMSEventInfo
infos from OpenCL event
Definition: GGEMSProfilerItem.hh:42
GGEMSProfilerItem::~GGEMSProfilerItem
~GGEMSProfilerItem(void)
GGEMSProfilerItem destructor.
Definition: GGEMSProfilerItem.hh:64
GGEMSProfilerItem::operator=
GGEMSProfilerItem & operator=(GGEMSProfilerItem const &&profiler_item)=delete
Avoid copy by rvalue reference.
GGEMSProfilerItem::GGEMSProfilerItem
GGEMSProfilerItem(GGEMSProfilerItem const &profiler_item)=delete
Avoid copy by reference.