CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
HcalSiPMParametersGPU Class Reference

#include <HcalSiPMParametersGPU.h>

Classes

struct  Product
 

Public Member Functions

const ProductgetProduct (cudaStream_t) const
 
 HcalSiPMParametersGPU (HcalSiPMParameters const &)
 
 ~HcalSiPMParametersGPU ()=default
 

Private Attributes

std::vector< int, cms::cuda::HostAllocator< int > > auxi1_
 
std::vector< float, cms::cuda::HostAllocator< float > > auxi2_
 
std::vector< float, cms::cuda::HostAllocator< float > > darkCurrent_
 
std::vector< float, cms::cuda::HostAllocator< float > > fcByPE_
 
cms::cuda::ESProduct< Productproduct_
 
uint64_t totalChannels_
 
std::vector< int, cms::cuda::HostAllocator< int > > type_
 

Detailed Description

Definition at line 13 of file HcalSiPMParametersGPU.h.

Constructor & Destructor Documentation

◆ HcalSiPMParametersGPU()

HcalSiPMParametersGPU::HcalSiPMParametersGPU ( HcalSiPMParameters const &  parameters)

Definition at line 6 of file HcalSiPMParametersGPU.cc.

7  : totalChannels_{parameters.getAllContainers()[0].second.size() + parameters.getAllContainers()[1].second.size()},
13  auto const containers = parameters.getAllContainers();
14 
15  // fill in eb
16  auto const& barrelValues = containers[0].second;
17  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
18  auto const& item = barrelValues[i];
19  type_[i] = item.getType();
20  auxi1_[i] = item.getauxi1();
21  fcByPE_[i] = item.getFCByPE();
22  darkCurrent_[i] = item.getDarkCurrent();
23  auxi2_[i] = item.getauxi2();
24  }
25 
26  // fill in ee
27  auto const& endcapValues = containers[1].second;
28  auto const offset = barrelValues.size();
29  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
30  auto const off = offset + i;
31  auto const& item = endcapValues[i];
32  type_[off] = item.getType();
33  auxi1_[off] = item.getauxi1();
34  fcByPE_[off] = item.getFCByPE();
35  darkCurrent_[off] = item.getDarkCurrent();
36  auxi2_[off] = item.getauxi2();
37  }
38 }

◆ ~HcalSiPMParametersGPU()

HcalSiPMParametersGPU::~HcalSiPMParametersGPU ( )
default

Member Function Documentation

◆ getProduct()

HcalSiPMParametersGPU::Product const & HcalSiPMParametersGPU::getProduct ( cudaStream_t  stream) const

Definition at line 40 of file HcalSiPMParametersGPU.cc.

40  {
41  auto const& product =
42  product_.dataForCurrentDeviceAsync(stream, [this](HcalSiPMParametersGPU::Product& product, cudaStream_t stream) {
43  // allocate
44  product.type = cms::cuda::make_device_unique<int[]>(type_.size(), stream);
45  product.auxi1 = cms::cuda::make_device_unique<int[]>(auxi1_.size(), stream);
46  product.fcByPE = cms::cuda::make_device_unique<float[]>(fcByPE_.size(), stream);
47  product.darkCurrent = cms::cuda::make_device_unique<float[]>(darkCurrent_.size(), stream);
48  product.auxi2 = cms::cuda::make_device_unique<float[]>(auxi2_.size(), stream);
49 
50  // transfer
56  });
57 
58  return product;
59 }

References HcalSiPMParametersGPU::Product::auxi1, auxi1_, HcalSiPMParametersGPU::Product::auxi2, auxi2_, cms::cuda::copyAsync(), HcalSiPMParametersGPU::Product::darkCurrent, darkCurrent_, HcalSiPMParametersGPU::Product::fcByPE, fcByPE_, product_, cms::cuda::stream, HcalSiPMParametersGPU::Product::type, and type_.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ auxi1_

std::vector<int, cms::cuda::HostAllocator<int> > HcalSiPMParametersGPU::auxi1_
private

Definition at line 35 of file HcalSiPMParametersGPU.h.

Referenced by getProduct().

◆ auxi2_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMParametersGPU::auxi2_
private

Definition at line 36 of file HcalSiPMParametersGPU.h.

Referenced by getProduct().

◆ darkCurrent_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMParametersGPU::darkCurrent_
private

Definition at line 36 of file HcalSiPMParametersGPU.h.

Referenced by getProduct().

◆ fcByPE_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMParametersGPU::fcByPE_
private

Definition at line 36 of file HcalSiPMParametersGPU.h.

Referenced by getProduct().

◆ product_

cms::cuda::ESProduct<Product> HcalSiPMParametersGPU::product_
private

Definition at line 38 of file HcalSiPMParametersGPU.h.

Referenced by getProduct().

◆ totalChannels_

uint64_t HcalSiPMParametersGPU::totalChannels_
private

Definition at line 34 of file HcalSiPMParametersGPU.h.

◆ type_

std::vector<int, cms::cuda::HostAllocator<int> > HcalSiPMParametersGPU::type_
private
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
HcalSiPMParametersGPU::Product::auxi1
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > auxi1
Definition: HcalSiPMParametersGPU.h:17
mps_fire.i
i
Definition: mps_fire.py:428
HcalSiPMParametersGPU::fcByPE_
std::vector< float, cms::cuda::HostAllocator< float > > fcByPE_
Definition: HcalSiPMParametersGPU.h:36
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HcalSiPMParametersGPU::Product
Definition: HcalSiPMParametersGPU.h:15
HcalSiPMParametersGPU::Product::darkCurrent
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > darkCurrent
Definition: HcalSiPMParametersGPU.h:19
HcalSiPMParametersGPU::Product::type
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > type
Definition: HcalSiPMParametersGPU.h:16
HcalSiPMParametersGPU::Product::auxi2
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > auxi2
Definition: HcalSiPMParametersGPU.h:20
HcalSiPMParametersGPU::totalChannels_
uint64_t totalChannels_
Definition: HcalSiPMParametersGPU.h:34
HcalSiPMParametersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalSiPMParametersGPU.h:38
HcalSiPMParametersGPU::darkCurrent_
std::vector< float, cms::cuda::HostAllocator< float > > darkCurrent_
Definition: HcalSiPMParametersGPU.h:36
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HcalSiPMParametersGPU::Product::fcByPE
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > fcByPE
Definition: HcalSiPMParametersGPU.h:18
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
HcalSiPMParametersGPU::type_
std::vector< int, cms::cuda::HostAllocator< int > > type_
Definition: HcalSiPMParametersGPU.h:35
HcalSiPMParametersGPU::auxi1_
std::vector< int, cms::cuda::HostAllocator< int > > auxi1_
Definition: HcalSiPMParametersGPU.h:35
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HcalSiPMParametersGPU::auxi2_
std::vector< float, cms::cuda::HostAllocator< float > > auxi2_
Definition: HcalSiPMParametersGPU.h:36
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20