CUDADataFormats
BeamSpot
interface
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
6
#include "
DataFormats/BeamSpot/interface/BeamSpotPOD.h
"
7
#include "
HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h
"
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
26
cms::cuda::device::unique_ptr<BeamSpotPOD>
&
ptr
() {
return
data_d_
; }
27
cms::cuda::device::unique_ptr<BeamSpotPOD>
const
&
ptr
()
const
{
return
data_d_
; }
28
29
private
:
30
cms::cuda::device::unique_ptr<BeamSpotPOD>
data_d_
;
31
};
32
33
#endif // CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
BeamSpotPOD.h
BeamSpotCUDA::data
BeamSpotPOD const * data() const
Definition:
BeamSpotCUDA.h:24
cms::cuda::stream
cudaStream_t stream
Definition:
HistoContainer.h:57
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
Generated for CMSSW Reference Manual by
1.8.16