Viskores  1.0
DeviceAdapterTimerImplementationCuda.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_cuda_internal_DeviceAdapterTimerImplementationCuda_h
19 #define viskores_cont_cuda_internal_DeviceAdapterTimerImplementationCuda_h
20 
22 
23 #include <viskores/Types.h>
24 
27 
28 #include <cuda.h>
29 
30 namespace viskores
31 {
32 namespace cont
33 {
34 
41 template <>
43 {
44 public:
46 
48 
49  VISKORES_CONT void Reset();
50 
51  VISKORES_CONT void Start();
52 
53  VISKORES_CONT void Stop();
54 
55  VISKORES_CONT bool Started() const;
56 
57  VISKORES_CONT bool Stopped() const;
58 
59  VISKORES_CONT bool Ready() const;
60 
61  VISKORES_CONT viskores::Float64 GetElapsedTime() const;
62 
63 private:
64  // Copying CUDA events is problematic.
68  delete;
69 
70  bool StartReady;
71  bool StopReady;
72  cudaEvent_t StartEvent;
73  cudaEvent_t StopEvent;
74 };
75 }
76 } // namespace viskores::cont
77 
78 
79 #endif
viskores::cont::DeviceAdapterTimerImplementation< viskores::cont::DeviceAdapterTagCuda >::StartReady
bool StartReady
Definition: DeviceAdapterTimerImplementationCuda.h:70
Types.h
viskores::cont::DeviceAdapterTagCuda
Tag for a device adapter that uses a CUDA capable GPU device.
Definition: DeviceAdapterTagCuda.h:41
DeviceAdapterAlgorithm.h
DeviceAdapterTagCuda.h
viskores::cont::DeviceAdapterTimerImplementation< viskores::cont::DeviceAdapterTagCuda >::StopEvent
cudaEvent_t StopEvent
Definition: DeviceAdapterTimerImplementationCuda.h:73
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::DeviceAdapterTimerImplementation< viskores::cont::DeviceAdapterTagCuda >::StartEvent
cudaEvent_t StartEvent
Definition: DeviceAdapterTimerImplementationCuda.h:72
viskores::cont::DeviceAdapterTimerImplementation
Class providing a device-specific timer.
Definition: DeviceAdapterAlgorithm.h:625
viskores::cont::DeviceAdapterTimerImplementation< viskores::cont::DeviceAdapterTagCuda >::StopReady
bool StopReady
Definition: DeviceAdapterTimerImplementationCuda.h:71
viskores::cont::DeviceAdapterTimerImplementation< viskores::cont::DeviceAdapterTagCuda >
Specialization of DeviceAdapterTimerImplementation for CUDA CUDA contains its own high resolution tim...
Definition: DeviceAdapterTimerImplementationCuda.h:42
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores_cont_export.h