VTK-m  2.0
DeviceAdapterTimerImplementationCuda.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_cuda_internal_DeviceAdapterTimerImplementationCuda_h
11 #define vtk_m_cont_cuda_internal_DeviceAdapterTimerImplementationCuda_h
12 
13 #include <vtkm/cont/vtkm_cont_export.h>
14 
15 #include <vtkm/Types.h>
16 
19 
20 #include <cuda.h>
21 
22 namespace vtkm
23 {
24 namespace cont
25 {
26 
33 template <>
34 class VTKM_CONT_EXPORT DeviceAdapterTimerImplementation<vtkm::cont::DeviceAdapterTagCuda>
35 {
36 public:
38 
40 
41  VTKM_CONT void Reset();
42 
43  VTKM_CONT void Start();
44 
45  VTKM_CONT void Stop();
46 
47  VTKM_CONT bool Started() const;
48 
49  VTKM_CONT bool Stopped() const;
50 
51  VTKM_CONT bool Ready() const;
52 
53  VTKM_CONT vtkm::Float64 GetElapsedTime() const;
54 
55 private:
56  // Copying CUDA events is problematic.
60  delete;
61 
62  bool StartReady;
63  bool StopReady;
64  cudaEvent_t StartEvent;
65  cudaEvent_t StopEvent;
66 };
67 }
68 } // namespace vtkm::cont
69 
70 
71 #endif
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagCuda >::StartReady
bool StartReady
Definition: DeviceAdapterTimerImplementationCuda.h:62
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagCuda >
Specialization of DeviceAdapterTimerImplementation for CUDA CUDA contains its own high resolution tim...
Definition: DeviceAdapterTimerImplementationCuda.h:34
DeviceAdapterAlgorithm.h
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagCuda >::StartEvent
cudaEvent_t StartEvent
Definition: DeviceAdapterTimerImplementationCuda.h:64
DeviceAdapterTagCuda.h
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagCuda >::StopReady
bool StopReady
Definition: DeviceAdapterTimerImplementationCuda.h:63
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::DeviceAdapterTimerImplementation
Class providing a device-specific timer.
Definition: DeviceAdapterAlgorithm.h:613
vtkm::cont::DeviceAdapterTimerImplementation< vtkm::cont::DeviceAdapterTagCuda >::StopEvent
cudaEvent_t StopEvent
Definition: DeviceAdapterTimerImplementationCuda.h:65
vtkm::Float64
double Float64
Definition: Types.h:155