CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
HGCUncalibRecHitDevice Class Reference

#include <HGCUncalibRecHitDevice.h>

Public Member Functions

void defineSoAMemoryLayout_ ()
 
HGCUncalibRecHitSoA get () const
 
 HGCUncalibRecHitDevice ()=default
 
 HGCUncalibRecHitDevice (uint32_t nhits, const cudaStream_t &stream)
 
 HGCUncalibRecHitDevice (const HGCUncalibRecHitDevice &)=delete
 
 HGCUncalibRecHitDevice (HGCUncalibRecHitDevice &&)=default
 
uint32_t nBytes () const
 
uint32_t nHits () const
 
HGCUncalibRecHitDeviceoperator= (const HGCUncalibRecHitDevice &)=delete
 
HGCUncalibRecHitDeviceoperator= (HGCUncalibRecHitDevice &&)=default
 
uint32_t pad () const
 
 ~HGCUncalibRecHitDevice ()=default
 

Private Attributes

uint32_t nhits_
 
uint32_t pad_
 
cms::cuda::device::unique_ptr< std::byte[]> ptr_
 
uint32_t size_tot_
 
HGCUncalibRecHitSoA soa_
 

Static Private Attributes

static constexpr std::array< int, memory::npointers::ntypes_hgcuncalibrechits_soasizes_
 

Detailed Description

Definition at line 11 of file HGCUncalibRecHitDevice.h.

Constructor & Destructor Documentation

◆ HGCUncalibRecHitDevice() [1/4]

HGCUncalibRecHitDevice::HGCUncalibRecHitDevice ( )
default

◆ HGCUncalibRecHitDevice() [2/4]

HGCUncalibRecHitDevice::HGCUncalibRecHitDevice ( uint32_t  nhits,
const cudaStream_t &  stream 
)
explicit

Definition at line 3 of file HGCUncalibRecHitDevice.cc.

References defineSoAMemoryLayout_(), nhits, pad_, ptr_, size_tot_, sizes_, and cms::cuda::stream.

3  : 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 }
cms::cuda::device::unique_ptr< std::byte[]> ptr_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static constexpr std::array< int, memory::npointers::ntypes_hgcuncalibrechits_soa > sizes_

◆ ~HGCUncalibRecHitDevice()

HGCUncalibRecHitDevice::~HGCUncalibRecHitDevice ( )
default

◆ HGCUncalibRecHitDevice() [3/4]

HGCUncalibRecHitDevice::HGCUncalibRecHitDevice ( const HGCUncalibRecHitDevice )
delete

◆ HGCUncalibRecHitDevice() [4/4]

HGCUncalibRecHitDevice::HGCUncalibRecHitDevice ( HGCUncalibRecHitDevice &&  )
default

Member Function Documentation

◆ defineSoAMemoryLayout_()

void HGCUncalibRecHitDevice::defineSoAMemoryLayout_ ( )

Definition at line 11 of file HGCUncalibRecHitDevice.cc.

References HGCUncalibRecHitSoA::amplitude_, HGCUncalibRecHitSoA::aux_, HGCUncalibRecHitSoA::chi2_, HGCUncalibRecHitSoA::flags_, HGCUncalibRecHitSoA::id_, HGCUncalibRecHitSoA::jitter_, HGCUncalibRecHitSoA::nbytes_, HGCUncalibRecHitSoA::nhits_, nhits_, HGCUncalibRecHitSoA::OOTamplitude_, HGCUncalibRecHitSoA::OOTchi2_, HGCUncalibRecHitSoA::pad_, pad_, HGCUncalibRecHitSoA::pedestal_, ptr_, size_tot_, and soa_.

Referenced by HGCUncalibRecHitDevice().

11  {
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 }
cms::cuda::device::unique_ptr< std::byte[]> ptr_
std::uint32_t * flags_

◆ get()

HGCUncalibRecHitSoA HGCUncalibRecHitDevice::get ( ) const
inline

◆ nBytes()

uint32_t HGCUncalibRecHitDevice::nBytes ( ) const
inline

Definition at line 26 of file HGCUncalibRecHitDevice.h.

References size_tot_.

26 { return size_tot_; }

◆ nHits()

uint32_t HGCUncalibRecHitDevice::nHits ( ) const
inline

Definition at line 24 of file HGCUncalibRecHitDevice.h.

References nhits_.

24 { return nhits_; }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

HGCUncalibRecHitDevice& HGCUncalibRecHitDevice::operator= ( HGCUncalibRecHitDevice &&  )
default

◆ pad()

uint32_t HGCUncalibRecHitDevice::pad ( ) const
inline

Definition at line 25 of file HGCUncalibRecHitDevice.h.

References pad_.

25 { return pad_; }

Member Data Documentation

◆ nhits_

uint32_t HGCUncalibRecHitDevice::nhits_
private

Definition at line 36 of file HGCUncalibRecHitDevice.h.

Referenced by defineSoAMemoryLayout_(), and nHits().

◆ pad_

uint32_t HGCUncalibRecHitDevice::pad_
private

Definition at line 35 of file HGCUncalibRecHitDevice.h.

Referenced by defineSoAMemoryLayout_(), HGCUncalibRecHitDevice(), and pad().

◆ ptr_

cms::cuda::device::unique_ptr<std::byte[]> HGCUncalibRecHitDevice::ptr_
private

Definition at line 29 of file HGCUncalibRecHitDevice.h.

Referenced by defineSoAMemoryLayout_(), and HGCUncalibRecHitDevice().

◆ size_tot_

uint32_t HGCUncalibRecHitDevice::size_tot_
private

Definition at line 37 of file HGCUncalibRecHitDevice.h.

Referenced by defineSoAMemoryLayout_(), HGCUncalibRecHitDevice(), and nBytes().

◆ sizes_

constexpr std::array<int, memory::npointers::ntypes_hgcuncalibrechits_soa> HGCUncalibRecHitDevice::sizes_
staticprivate
Initial value:

Definition at line 31 of file HGCUncalibRecHitDevice.h.

Referenced by HGCUncalibRecHitDevice().

◆ soa_

HGCUncalibRecHitSoA HGCUncalibRecHitDevice::soa_
private

Definition at line 30 of file HGCUncalibRecHitDevice.h.

Referenced by defineSoAMemoryLayout_(), and get().