VTK-m  2.2
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 
16 
17 #include <memory>
18 
19 namespace vtkm
20 {
21 namespace cont
22 {
23 namespace detail
24 {
25 struct EnabledDeviceTimerImpls;
26 }
27 
44 {
45 public:
46  VTKM_CONT
47  Timer();
48 
50 
51  VTKM_CONT ~Timer();
52 
57  VTKM_CONT void Reset();
58 
60  VTKM_CONT void Reset(vtkm::cont::DeviceAdapterId device);
61 
65  VTKM_CONT void Start();
66 
71  VTKM_CONT void Stop();
72 
76  VTKM_CONT bool Started() const;
77 
82  VTKM_CONT bool Stopped() const;
83 
85  VTKM_CONT bool Ready() const;
86 
94  VTKM_CONT
95  vtkm::Float64 GetElapsedTime() const;
96 
101  VTKM_CONT vtkm::cont::DeviceAdapterId GetDevice() const { return this->Device; }
102 
111  VTKM_CONT void Synchronize() const;
112 
113 private:
115  VTKM_CONT Timer(const Timer&) = delete;
116  VTKM_CONT void operator=(const Timer&) = delete;
117 
119  std::unique_ptr<detail::EnabledDeviceTimerImpls> Internal;
120 };
121 }
122 } // namespace vtkm::cont
123 
124 #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::DeviceAdapterId GetDevice() const
Returns the id of the device adapter for which this timer is synchronized.
Definition: Timer.h:101
VTKM_CONT_EXPORT
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
vtkm_cont_export.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::Timer::Device
vtkm::cont::DeviceAdapterId Device
Definition: Timer.h:118
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
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
vtkm::cont::Timer::Internal
std::unique_ptr< detail::EnabledDeviceTimerImpls > Internal
Definition: Timer.h:119