VTK-m  2.0
Timer.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_Timer_h
11 #define vtk_m_cont_Timer_h
12 
14 
15 #include <vtkm/cont/vtkm_cont_export.h>
16 
17 #include <memory>
18 
19 namespace vtkm
20 {
21 namespace cont
22 {
23 namespace detail
24 {
25 struct EnabledDeviceTimerImpls;
26 }
27 
43 class VTKM_CONT_EXPORT Timer
44 {
45 public:
46  VTKM_CONT
47  Timer();
48 
50 
51  VTKM_CONT ~Timer();
52 
54  VTKM_CONT void Reset();
55 
57  VTKM_CONT void Reset(vtkm::cont::DeviceAdapterId device);
58 
59  VTKM_CONT void Start();
60 
61  VTKM_CONT void Stop();
62 
63  VTKM_CONT bool Started() const;
64 
65  VTKM_CONT bool Stopped() const;
66 
68  VTKM_CONT bool Ready() const;
69 
72  VTKM_CONT
73  vtkm::Float64 GetElapsedTime() const;
74 
77  VTKM_CONT vtkm::cont::DeviceAdapterId GetDevice() const { return this->Device; }
78 
87  VTKM_CONT void Synchronize() const;
88 
89 private:
91  VTKM_CONT Timer(const Timer&) = delete;
92  VTKM_CONT void operator=(const Timer&) = delete;
93 
95  std::unique_ptr<detail::EnabledDeviceTimerImpls> Internal;
96 };
97 }
98 } // namespace vtkm::cont
99 
100 #endif //vtk_m_cont_Timer_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
DeviceAdapterTag.h
vtkm::cont::Timer::GetDevice
VTKM_CONT vtkm::cont::DeviceAdapterId GetDevice() const
Returns the device for which this timer is synchronized.
Definition: Timer.h:77
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::Timer::Device
vtkm::cont::DeviceAdapterId Device
Definition: Timer.h:94
vtkm::cont::Timer
A class that can be used to time operations in VTK-m that might be occuring in parallel.
Definition: Timer.h:43
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::cont::Timer::Internal
std::unique_ptr< detail::EnabledDeviceTimerImpls > Internal
Definition: Timer.h:95