CMS 3D CMS Logo

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

#include <HGCRecHitGPUProduct.h>

Public Member Functions

HGCRecHitSoA get ()
 
ConstHGCRecHitSoA get () const
 
 HGCRecHitGPUProduct ()=default
 
 HGCRecHitGPUProduct (uint32_t nhits, const cudaStream_t &stream)
 
 HGCRecHitGPUProduct (const HGCRecHitGPUProduct &)=delete
 
 HGCRecHitGPUProduct (HGCRecHitGPUProduct &&)=default
 
uint32_t nBytes () const
 
uint32_t nHits () const
 
HGCRecHitGPUProductoperator= (const HGCRecHitGPUProduct &)=delete
 
HGCRecHitGPUProductoperator= (HGCRecHitGPUProduct &&)=default
 
uint32_t pad () const
 
 ~HGCRecHitGPUProduct ()=default
 

Private Attributes

cms::cuda::device::unique_ptr< std::byte[]> mem_
 
uint32_t nhits_
 
uint32_t pad_
 
uint32_t size_tot_
 

Static Private Attributes

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

Detailed Description

Definition at line 12 of file HGCRecHitGPUProduct.h.

Constructor & Destructor Documentation

◆ HGCRecHitGPUProduct() [1/4]

HGCRecHitGPUProduct::HGCRecHitGPUProduct ( )
default

◆ HGCRecHitGPUProduct() [2/4]

HGCRecHitGPUProduct::HGCRecHitGPUProduct ( uint32_t  nhits,
const cudaStream_t &  stream 
)
inlineexplicit

Definition at line 15 of file HGCRecHitGPUProduct.h.

References mem_, nhits, pad_, size_tot_, sizes_, and cms::cuda::stream.

15  : nhits_(nhits) {
16  size_tot_ = std::accumulate(sizes_.begin(), sizes_.end(), 0); //this might be done at compile time
17  pad_ = ((nhits - 1) / 32 + 1) * 32; //align to warp boundary (assumption: warpSize = 32)
18  mem_ = cms::cuda::make_device_unique<std::byte[]>(pad_ * size_tot_, stream);
19  }
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_hgcrechits_soa > sizes_
cms::cuda::device::unique_ptr< std::byte[]> mem_

◆ ~HGCRecHitGPUProduct()

HGCRecHitGPUProduct::~HGCRecHitGPUProduct ( )
default

◆ HGCRecHitGPUProduct() [3/4]

HGCRecHitGPUProduct::HGCRecHitGPUProduct ( const HGCRecHitGPUProduct )
delete

◆ HGCRecHitGPUProduct() [4/4]

HGCRecHitGPUProduct::HGCRecHitGPUProduct ( HGCRecHitGPUProduct &&  )
default

Member Function Documentation

◆ get() [1/2]

HGCRecHitSoA HGCRecHitGPUProduct::get ( )
inline

Definition at line 27 of file HGCRecHitGPUProduct.h.

References mem_, nhits_, pad_, size_tot_, and gpuVertexFinder::soa.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), HEBRecHitGPU::produce(), EERecHitGPU::produce(), HEFRecHitGPU::produce(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), util.rrapi.RRApi::templates(), rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

27  {
29  soa.energy_ = reinterpret_cast<float *>(mem_.get());
30  soa.time_ = soa.energy_ + pad_;
31  soa.timeError_ = soa.time_ + pad_;
32  soa.id_ = reinterpret_cast<uint32_t *>(soa.timeError_ + pad_);
33  soa.flagBits_ = soa.id_ + pad_;
34  soa.son_ = reinterpret_cast<uint8_t *>(soa.flagBits_ + pad_);
35  soa.nbytes_ = size_tot_;
36  soa.nhits_ = nhits_;
37  soa.pad_ = pad_;
38  return soa;
39  }
ZVertexSoA * soa
cms::cuda::device::unique_ptr< std::byte[]> mem_

◆ get() [2/2]

ConstHGCRecHitSoA HGCRecHitGPUProduct::get ( ) const
inline

Definition at line 40 of file HGCRecHitGPUProduct.h.

References mem_, pad_, and gpuVertexFinder::soa.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

40  {
42  soa.energy_ = reinterpret_cast<float const *>(mem_.get());
43  soa.time_ = soa.energy_ + pad_;
44  soa.timeError_ = soa.time_ + pad_;
45  soa.id_ = reinterpret_cast<uint32_t const *>(soa.timeError_ + pad_);
46  soa.flagBits_ = soa.id_ + pad_;
47  soa.son_ = reinterpret_cast<uint8_t const *>(soa.flagBits_ + pad_);
48  return soa;
49  }
ZVertexSoA * soa
cms::cuda::device::unique_ptr< std::byte[]> mem_

◆ nBytes()

uint32_t HGCRecHitGPUProduct::nBytes ( ) const
inline

Definition at line 56 of file HGCRecHitGPUProduct.h.

References size_tot_.

56 { return size_tot_; }

◆ nHits()

uint32_t HGCRecHitGPUProduct::nHits ( ) const
inline

Definition at line 52 of file HGCRecHitGPUProduct.h.

References nhits_.

52 { return nhits_; }

◆ operator=() [1/2]

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

◆ operator=() [2/2]

HGCRecHitGPUProduct& HGCRecHitGPUProduct::operator= ( HGCRecHitGPUProduct &&  )
default

◆ pad()

uint32_t HGCRecHitGPUProduct::pad ( ) const
inline

Definition at line 54 of file HGCRecHitGPUProduct.h.

References pad_.

54 { return pad_; }

Member Data Documentation

◆ mem_

cms::cuda::device::unique_ptr<std::byte[]> HGCRecHitGPUProduct::mem_
private

Definition at line 59 of file HGCRecHitGPUProduct.h.

Referenced by get(), and HGCRecHitGPUProduct().

◆ nhits_

uint32_t HGCRecHitGPUProduct::nhits_
private

Definition at line 65 of file HGCRecHitGPUProduct.h.

Referenced by get(), and nHits().

◆ pad_

uint32_t HGCRecHitGPUProduct::pad_
private

Definition at line 64 of file HGCRecHitGPUProduct.h.

Referenced by get(), HGCRecHitGPUProduct(), and pad().

◆ size_tot_

uint32_t HGCRecHitGPUProduct::size_tot_
private

Definition at line 66 of file HGCRecHitGPUProduct.h.

Referenced by get(), HGCRecHitGPUProduct(), and nBytes().

◆ sizes_

constexpr std::array<int, memory::npointers::ntypes_hgcrechits_soa> HGCRecHitGPUProduct::sizes_
staticprivate
Initial value:

Definition at line 60 of file HGCRecHitGPUProduct.h.

Referenced by HGCRecHitGPUProduct().