CMS 3D CMS Logo

SiStripClustersCUDA.cc
Go to the documentation of this file.
3 
5  uint32_t maxStripsPerCluster,
6  cudaStream_t stream) {
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 }
35 
37  nClusters_ = clusters_d.nClusters();
38  maxClusterSize_ = clusters_d.maxClusterSize();
39  clusterIndex_ = cms::cuda::make_host_unique<uint32_t[]>(nClusters_, stream);
40  clusterSize_ = cms::cuda::make_host_unique<uint32_t[]>(nClusters_, stream);
41  clusterADCs_ = cms::cuda::make_host_unique<uint8_t[]>(nClusters_ * maxClusterSize_, stream);
42  clusterDetId_ = cms::cuda::make_host_unique<stripgpu::detId_t[]>(nClusters_, stream);
43  firstStrip_ = cms::cuda::make_host_unique<stripgpu::stripId_t[]>(nClusters_, stream);
44  trueCluster_ = cms::cuda::make_host_unique<bool[]>(nClusters_, stream);
45  barycenter_ = cms::cuda::make_host_unique<float[]>(nClusters_, stream);
46  charge_ = cms::cuda::make_host_unique<float[]>(nClusters_, stream);
47 
56 #ifdef GPU_CHECK
57  cudaCheck(cudaStreamSynchronize(stream));
58 #endif
59 }
const auto & clusterSize() const
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_
SiStripClustersCUDADevice()=default
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
const auto & clusterIndex() const
const auto & barycenter() const
const auto & firstStrip() const
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
const auto & trueCluster() const
const auto & charge() const
const auto & clusterADCs() const
cms::cuda::device::unique_ptr< uint32_t[]> clusterIndex_
DeviceView * view() const
SiStripClustersCUDAHost()=default
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
const auto & clusterDetId() const
cms::cuda::device::unique_ptr< stripgpu::stripId_t[]> firstStrip_