CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
HGCRecHitCPUProduct Class Reference

#include <HGCRecHitCPUProduct.h>

Public Member Functions

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

Private Attributes

cms::cuda::host::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_soa
sizes_
 

Detailed Description

Definition at line 12 of file HGCRecHitCPUProduct.h.

Constructor & Destructor Documentation

HGCRecHitCPUProduct::HGCRecHitCPUProduct ( )
default
HGCRecHitCPUProduct::HGCRecHitCPUProduct ( uint32_t  nhits,
const cudaStream_t &  stream 
)
inlineexplicit

Definition at line 15 of file HGCRecHitCPUProduct.h.

References mem_, 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_host_unique<std::byte[]>(pad_ * size_tot_, stream);
19  }
static constexpr std::array< int, memory::npointers::ntypes_hgcrechits_soa > sizes_
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
cms::cuda::host::unique_ptr< std::byte[]> mem_
HGCRecHitCPUProduct::~HGCRecHitCPUProduct ( )
default
HGCRecHitCPUProduct::HGCRecHitCPUProduct ( const HGCRecHitCPUProduct )
delete
HGCRecHitCPUProduct::HGCRecHitCPUProduct ( HGCRecHitCPUProduct &&  )
default

Member Function Documentation

HGCRecHitSoA HGCRecHitCPUProduct::get ( )
inline

Definition at line 27 of file HGCRecHitCPUProduct.h.

References HGCRecHitSoA::energy_, HGCRecHitSoA::flagBits_, HGCRecHitSoA::id_, mem_, HGCRecHitSoA::nbytes_, HGCRecHitSoA::nhits_, nhits_, HGCRecHitSoA::pad_, pad_, size_tot_, gpuVertexFinder::soa, HGCRecHitSoA::son_, HGCRecHitSoA::time_, and HGCRecHitSoA::timeError_.

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(), EERecHitFromSoA::produce(), HEFRecHitFromSoA::produce(), HEBRecHitFromSoA::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(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.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  }
uint32_t * flagBits_
Definition: HGCRecHitSoA.h:12
uint32_t * id_
Definition: HGCRecHitSoA.h:11
uint8_t * son_
Definition: HGCRecHitSoA.h:13
float * energy_
Definition: HGCRecHitSoA.h:8
uint32_t pad_
Definition: HGCRecHitSoA.h:17
ZVertexSoA * soa
uint32_t nbytes_
Definition: HGCRecHitSoA.h:15
cms::cuda::host::unique_ptr< std::byte[]> mem_
float * time_
Definition: HGCRecHitSoA.h:9
float * timeError_
Definition: HGCRecHitSoA.h:10
uint32_t nhits_
Definition: HGCRecHitSoA.h:16
ConstHGCRecHitSoA HGCRecHitCPUProduct::get ( ) const
inline

Definition at line 40 of file HGCRecHitCPUProduct.h.

References ConstHGCRecHitSoA::energy_, ConstHGCRecHitSoA::flagBits_, ConstHGCRecHitSoA::id_, mem_, pad_, gpuVertexFinder::soa, ConstHGCRecHitSoA::son_, ConstHGCRecHitSoA::time_, and ConstHGCRecHitSoA::timeError_.

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  }
uint32_t const * id_
float const * time_
ZVertexSoA * soa
float const * energy_
uint32_t const * flagBits_
cms::cuda::host::unique_ptr< std::byte[]> mem_
float const * timeError_
uint8_t const * son_
uint32_t HGCRecHitCPUProduct::nBytes ( ) const
inline

Definition at line 52 of file HGCRecHitCPUProduct.h.

References size_tot_.

52 { return size_tot_; }
uint32_t HGCRecHitCPUProduct::nHits ( ) const
inline

Definition at line 50 of file HGCRecHitCPUProduct.h.

References nhits_.

Referenced by EERecHitFromSoA::produce(), HEFRecHitFromSoA::produce(), and HEBRecHitFromSoA::produce().

50 { return nhits_; }
HGCRecHitCPUProduct& HGCRecHitCPUProduct::operator= ( const HGCRecHitCPUProduct )
delete
HGCRecHitCPUProduct& HGCRecHitCPUProduct::operator= ( HGCRecHitCPUProduct &&  )
default
uint32_t HGCRecHitCPUProduct::pad ( ) const
inline

Definition at line 51 of file HGCRecHitCPUProduct.h.

References pad_.

51 { return pad_; }

Member Data Documentation

cms::cuda::host::unique_ptr<std::byte[]> HGCRecHitCPUProduct::mem_
private

Definition at line 55 of file HGCRecHitCPUProduct.h.

Referenced by get(), and HGCRecHitCPUProduct().

uint32_t HGCRecHitCPUProduct::nhits_
private

Definition at line 61 of file HGCRecHitCPUProduct.h.

Referenced by get(), and nHits().

uint32_t HGCRecHitCPUProduct::pad_
private

Definition at line 60 of file HGCRecHitCPUProduct.h.

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

uint32_t HGCRecHitCPUProduct::size_tot_
private

Definition at line 62 of file HGCRecHitCPUProduct.h.

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

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

Definition at line 56 of file HGCRecHitCPUProduct.h.

Referenced by HGCRecHitCPUProduct().