CMS 3D CMS Logo

BeamSpotCUDA.h
Go to the documentation of this file.
1 #ifndef CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
2 #define CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
3 
4 #include <cuda_runtime.h>
5 
8 
9 class BeamSpotCUDA {
10 public:
11  // default constructor, required by cms::cuda::Product<BeamSpotCUDA>
12  BeamSpotCUDA() = default;
13 
14  // constructor that allocates cached device memory on the given CUDA stream
15  BeamSpotCUDA(cudaStream_t stream) { data_d_ = cms::cuda::make_device_unique<BeamSpotPOD>(stream); }
16 
17  // movable, non-copiable
18  BeamSpotCUDA(BeamSpotCUDA const&) = delete;
19  BeamSpotCUDA(BeamSpotCUDA&&) = default;
20  BeamSpotCUDA& operator=(BeamSpotCUDA const&) = delete;
21  BeamSpotCUDA& operator=(BeamSpotCUDA&&) = default;
22 
23  BeamSpotPOD* data() { return data_d_.get(); }
24  BeamSpotPOD const* data() const { return data_d_.get(); }
25 
28 
29 private:
31 };
32 
33 #endif // CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
BeamSpotPOD.h
BeamSpotCUDA::data
BeamSpotPOD const * data() const
Definition: BeamSpotCUDA.h:24
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
device_unique_ptr.h
BeamSpotCUDA::ptr
cms::cuda::device::unique_ptr< BeamSpotPOD > const & ptr() const
Definition: BeamSpotCUDA.h:27
BeamSpotCUDA
Definition: BeamSpotCUDA.h:9
BeamSpotCUDA::BeamSpotCUDA
BeamSpotCUDA(cudaStream_t stream)
Definition: BeamSpotCUDA.h:15
BeamSpotCUDA::data_d_
cms::cuda::device::unique_ptr< BeamSpotPOD > data_d_
Definition: BeamSpotCUDA.h:30
BeamSpotCUDA::ptr
cms::cuda::device::unique_ptr< BeamSpotPOD > & ptr()
Definition: BeamSpotCUDA.h:26
BeamSpotCUDA::operator=
BeamSpotCUDA & operator=(BeamSpotCUDA const &)=delete
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
BeamSpotPOD
Definition: BeamSpotPOD.h:11
BeamSpotCUDA::data
BeamSpotPOD * data()
Definition: BeamSpotCUDA.h:23
BeamSpotCUDA::BeamSpotCUDA
BeamSpotCUDA()=default