CMS 3D CMS Logo

HGCUncalibRecHitDevice.cc
Go to the documentation of this file.
2 
3 HGCUncalibRecHitDevice::HGCUncalibRecHitDevice(uint32_t nhits, const cudaStream_t& stream) : nhits_(nhits) {
4  size_tot_ = std::accumulate(sizes_.begin(), sizes_.end(), 0); //this might be done at compile time
5  pad_ = ((nhits - 1) / 32 + 1) * 32; //align to warp boundary (assumption: warpSize = 32)
6  ptr_ = cms::cuda::make_device_unique<std::byte[]>(pad_ * size_tot_, stream);
7 
9 }
10 
12  soa_.amplitude_ = reinterpret_cast<float*>(ptr_.get());
18  soa_.flags_ = reinterpret_cast<uint32_t*>(soa_.OOTchi2_ + pad_);
19  soa_.aux_ = soa_.flags_ + pad_;
20  soa_.id_ = soa_.aux_ + pad_;
21 
23  soa_.nhits_ = nhits_;
24  soa_.pad_ = pad_;
25 }
HGCUncalibRecHitDevice::size_tot_
uint32_t size_tot_
Definition: HGCUncalibRecHitDevice.h:37
HGCUncalibRecHitSoA::jitter_
float * jitter_
Definition: HGCUncalibRecHitSoA.h:10
HGCUncalibRecHitSoA::pad_
std::uint32_t pad_
Definition: HGCUncalibRecHitSoA.h:21
HGCUncalibRecHitSoA::amplitude_
float * amplitude_
Definition: HGCUncalibRecHitSoA.h:8
HGCUncalibRecHitDevice::ptr_
cms::cuda::device::unique_ptr< std::byte[]> ptr_
Definition: HGCUncalibRecHitDevice.h:29
HGCUncalibRecHitSoA::nhits_
std::uint32_t nhits_
Definition: HGCUncalibRecHitSoA.h:20
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HGCUncalibRecHitSoA::pedestal_
float * pedestal_
Definition: HGCUncalibRecHitSoA.h:9
HGCUncalibRecHitDevice::soa_
HGCUncalibRecHitSoA soa_
Definition: HGCUncalibRecHitDevice.h:30
HGCUncalibRecHitSoA::aux_
std::uint32_t * aux_
Definition: HGCUncalibRecHitSoA.h:16
HGCUncalibRecHitSoA::chi2_
float * chi2_
Definition: HGCUncalibRecHitSoA.h:11
HGCUncalibRecHitDevice::HGCUncalibRecHitDevice
HGCUncalibRecHitDevice()=default
HGCUncalibRecHitSoA::id_
std::uint32_t * id_
Definition: HGCUncalibRecHitSoA.h:17
HGCUncalibRecHitDevice::sizes_
static constexpr std::array< int, memory::npointers::ntypes_hgcuncalibrechits_soa > sizes_
Definition: HGCUncalibRecHitDevice.h:31
HGCUncalibRecHitDevice::nhits_
uint32_t nhits_
Definition: HGCUncalibRecHitDevice.h:36
nhits
Definition: HIMultiTrackSelector.h:42
HGCUncalibRecHitSoA::nbytes_
std::uint32_t nbytes_
Definition: HGCUncalibRecHitSoA.h:19
HGCUncalibRecHitSoA::OOTchi2_
float * OOTchi2_
Definition: HGCUncalibRecHitSoA.h:13
HGCUncalibRecHitDevice::pad_
uint32_t pad_
Definition: HGCUncalibRecHitDevice.h:35
HGCUncalibRecHitSoA::flags_
std::uint32_t * flags_
Definition: HGCUncalibRecHitSoA.h:15
HGCUncalibRecHitSoA::OOTamplitude_
float * OOTamplitude_
Definition: HGCUncalibRecHitSoA.h:12
HGCUncalibRecHitDevice.h
HGCUncalibRecHitDevice::defineSoAMemoryLayout_
void defineSoAMemoryLayout_()
Definition: HGCUncalibRecHitDevice.cc:11