CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
SiStripClustersCUDADevice Class Reference

#include <SiStripClustersCUDA.h>

Inheritance diagram for SiStripClustersCUDADevice:
SiStripClustersSOABase< cms::cuda::device::unique_ptr >

Classes

struct  DeviceView
 

Public Member Functions

uint32_t maxClusterSize () const
 
uint32_t * maxClusterSizePtr ()
 
uint32_t nClusters () const
 
uint32_t * nClustersPtr ()
 
SiStripClustersCUDADeviceoperator= (const SiStripClustersCUDADevice &)=delete
 
SiStripClustersCUDADeviceoperator= (SiStripClustersCUDADevice &&)=default
 
 SiStripClustersCUDADevice ()=default
 
 SiStripClustersCUDADevice (uint32_t maxClusters, uint32_t maxStripsPerCluster, cudaStream_t stream)
 
 SiStripClustersCUDADevice (const SiStripClustersCUDADevice &)=delete
 
 SiStripClustersCUDADevice (SiStripClustersCUDADevice &&)=default
 
DeviceViewview () const
 
 ~SiStripClustersCUDADevice () override=default
 
- Public Member Functions inherited from SiStripClustersSOABase< cms::cuda::device::unique_ptr >
const auto & barycenter () const
 
auto & barycenter ()
 
const auto & charge () const
 
auto & charge ()
 
const auto & clusterADCs () const
 
auto & clusterADCs ()
 
const auto & clusterDetId () const
 
auto & clusterDetId ()
 
const auto & clusterIndex () const
 
auto & clusterIndex ()
 
const auto & clusterSize () const
 
auto & clusterSize ()
 
const auto & firstStrip () const
 
auto & firstStrip ()
 
uint32_t maxClusterSize () const
 
uint32_t nClusters () const
 
SiStripClustersSOABaseoperator= (const SiStripClustersSOABase &)=delete
 
SiStripClustersSOABaseoperator= (SiStripClustersSOABase &&)=default
 
void setMaxClusterSize (uint32_t maxClusterSize)
 
void setNClusters (uint32_t nClusters)
 
 SiStripClustersSOABase ()=default
 
 SiStripClustersSOABase (const SiStripClustersSOABase &)=delete
 
 SiStripClustersSOABase (SiStripClustersSOABase &&)=default
 
const auto & trueCluster () const
 
auto & trueCluster ()
 
virtual ~SiStripClustersSOABase ()=default
 

Private Attributes

uint32_t maxClusterSize_
 
uint32_t nClusters_
 
cms::cuda::device::unique_ptr< DeviceViewview_d
 

Additional Inherited Members

- Protected Attributes inherited from SiStripClustersSOABase< cms::cuda::device::unique_ptr >
cms::cuda::device::unique_ptr< float[]> barycenter_
 
cms::cuda::device::unique_ptr< float[]> charge_
 
cms::cuda::device::unique_ptr< uint8_t[]> clusterADCs_
 
cms::cuda::device::unique_ptr< stripgpu::detId_t[]> clusterDetId_
 
cms::cuda::device::unique_ptr< uint32_t[]> clusterIndex_
 
cms::cuda::device::unique_ptr< uint32_t[]> clusterSize_
 
cms::cuda::device::unique_ptr< stripgpu::stripId_t[]> firstStrip_
 
uint32_t maxClusterSize_
 
uint32_t nClusters_
 
cms::cuda::device::unique_ptr< bool[]> trueCluster_
 

Detailed Description

Definition at line 11 of file SiStripClustersCUDA.h.

Constructor & Destructor Documentation

◆ SiStripClustersCUDADevice() [1/4]

SiStripClustersCUDADevice::SiStripClustersCUDADevice ( )
default

◆ SiStripClustersCUDADevice() [2/4]

SiStripClustersCUDADevice::SiStripClustersCUDADevice ( uint32_t  maxClusters,
uint32_t  maxStripsPerCluster,
cudaStream_t  stream 
)
explicit

Definition at line 4 of file SiStripClustersCUDA.cc.

References SiStripClustersCUDADevice::DeviceView::barycenter_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::barycenter_, SiStripClustersCUDADevice::DeviceView::charge_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::charge_, SiStripClustersCUDADevice::DeviceView::clusterADCs_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::clusterADCs_, SiStripClustersCUDADevice::DeviceView::clusterDetId_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::clusterDetId_, SiStripClustersCUDADevice::DeviceView::clusterIndex_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::clusterIndex_, SiStripClustersCUDADevice::DeviceView::clusterSize_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::clusterSize_, cms::cuda::copyAsync(), cudaCheck, SiStripClustersCUDADevice::DeviceView::firstStrip_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::firstStrip_, beam_dqm_sourceclient-live_cfg::maxClusters, SiStripClustersCUDADevice::DeviceView::maxClusterSize_, maxClusterSize_, cms::cuda::stream, SiStripClustersCUDADevice::DeviceView::trueCluster_, SiStripClustersSOABase< cms::cuda::device::unique_ptr >::trueCluster_, view(), and view_d.

6  {
7  maxClusterSize_ = maxStripsPerCluster;
8 
9  clusterIndex_ = cms::cuda::make_device_unique<uint32_t[]>(maxClusters, stream);
10  clusterSize_ = cms::cuda::make_device_unique<uint32_t[]>(maxClusters, stream);
11  clusterADCs_ = cms::cuda::make_device_unique<uint8_t[]>(maxClusters * maxStripsPerCluster, stream);
12  clusterDetId_ = cms::cuda::make_device_unique<stripgpu::detId_t[]>(maxClusters, stream);
13  firstStrip_ = cms::cuda::make_device_unique<stripgpu::stripId_t[]>(maxClusters, stream);
14  trueCluster_ = cms::cuda::make_device_unique<bool[]>(maxClusters, stream);
15  barycenter_ = cms::cuda::make_device_unique<float[]>(maxClusters, stream);
16  charge_ = cms::cuda::make_device_unique<float[]>(maxClusters, stream);
17 
18  auto view = cms::cuda::make_host_unique<DeviceView>(stream);
23  view->firstStrip_ = firstStrip_.get();
25  view->barycenter_ = barycenter_.get();
26  view->charge_ = charge_.get();
27  view->maxClusterSize_ = maxStripsPerCluster;
28 
29  view_d = cms::cuda::make_device_unique<DeviceView>(stream);
31 #ifdef GPU_CHECK
32  cudaCheck(cudaStreamSynchronize(stream));
33 #endif
34 }
cms::cuda::device::unique_ptr< uint8_t[]> clusterADCs_
cms::cuda::device::unique_ptr< DeviceView > view_d
cms::cuda::device::unique_ptr< uint32_t[]> clusterSize_
cms::cuda::device::unique_ptr< stripgpu::detId_t[]> clusterDetId_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
cms::cuda::device::unique_ptr< uint32_t[]> clusterIndex_
DeviceView * view() const
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
cms::cuda::device::unique_ptr< stripgpu::stripId_t[]> firstStrip_

◆ ~SiStripClustersCUDADevice()

SiStripClustersCUDADevice::~SiStripClustersCUDADevice ( )
overridedefault

◆ SiStripClustersCUDADevice() [3/4]

SiStripClustersCUDADevice::SiStripClustersCUDADevice ( const SiStripClustersCUDADevice )
delete

◆ SiStripClustersCUDADevice() [4/4]

SiStripClustersCUDADevice::SiStripClustersCUDADevice ( SiStripClustersCUDADevice &&  )
default

Member Function Documentation

◆ maxClusterSize()

uint32_t SiStripClustersCUDADevice::maxClusterSize ( ) const
inline

Definition at line 38 of file SiStripClustersCUDA.h.

References maxClusterSize_.

Referenced by SiStripClustersCUDAHost::SiStripClustersCUDAHost().

38 { return maxClusterSize_; }

◆ maxClusterSizePtr()

uint32_t* SiStripClustersCUDADevice::maxClusterSizePtr ( )
inline

Definition at line 39 of file SiStripClustersCUDA.h.

References maxClusterSize_.

39 { return &maxClusterSize_; }

◆ nClusters()

uint32_t SiStripClustersCUDADevice::nClusters ( ) const
inline

Definition at line 36 of file SiStripClustersCUDA.h.

References nClusters_.

Referenced by SiStripClustersCUDAHost::SiStripClustersCUDAHost().

36 { return nClusters_; }

◆ nClustersPtr()

uint32_t* SiStripClustersCUDADevice::nClustersPtr ( )
inline

Definition at line 37 of file SiStripClustersCUDA.h.

References nClusters_.

37 { return &nClusters_; }

◆ operator=() [1/2]

SiStripClustersCUDADevice& SiStripClustersCUDADevice::operator= ( const SiStripClustersCUDADevice )
delete

◆ operator=() [2/2]

SiStripClustersCUDADevice& SiStripClustersCUDADevice::operator= ( SiStripClustersCUDADevice &&  )
default

◆ view()

DeviceView* SiStripClustersCUDADevice::view ( ) const
inline

Definition at line 35 of file SiStripClustersCUDA.h.

References view_d.

Referenced by SiStripClustersCUDADevice().

35 { return view_d.get(); }
cms::cuda::device::unique_ptr< DeviceView > view_d

Member Data Documentation

◆ maxClusterSize_

uint32_t SiStripClustersCUDADevice::maxClusterSize_
private

◆ nClusters_

uint32_t SiStripClustersCUDADevice::nClusters_
private

Definition at line 43 of file SiStripClustersCUDA.h.

Referenced by nClusters(), and nClustersPtr().

◆ view_d

cms::cuda::device::unique_ptr<DeviceView> SiStripClustersCUDADevice::view_d
private

Definition at line 42 of file SiStripClustersCUDA.h.

Referenced by SiStripClustersCUDADevice(), and view().