CMS 3D CMS Logo

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

#include <HcalRecoParamsGPU.h>

Classes

struct  Product
 

Public Member Functions

Product const & getProduct (cudaStream_t) const
 
 HcalRecoParamsGPU (HcalRecoParams const &)
 
 ~HcalRecoParamsGPU ()=default
 

Private Attributes

std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param1_
 
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param2_
 
cms::cuda::ESProduct< Productproduct_
 
uint64_t totalChannels_
 

Detailed Description

Definition at line 14 of file HcalRecoParamsGPU.h.

Constructor & Destructor Documentation

◆ HcalRecoParamsGPU()

HcalRecoParamsGPU::HcalRecoParamsGPU ( HcalRecoParams const &  recoParams)

Definition at line 7 of file HcalRecoParamsGPU.cc.

8  : totalChannels_{recoParams.getAllContainers()[0].second.size() + recoParams.getAllContainers()[1].second.size()},
11  auto const& containers = recoParams.getAllContainers();
12 
13  // fill in eb
14  auto const& barrelValues = containers[0].second;
15  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
16  param1_[i] = barrelValues[i].param1();
17  param2_[i] = barrelValues[i].param2();
18  }
19 
20  // fill in ee
21  auto const& endcapValues = containers[1].second;
22  auto const offset = barrelValues.size();
23  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
24  param1_[i + offset] = endcapValues[i].param1();
25  param2_[i + offset] = endcapValues[i].param2();
26  }
27 }

References HcalCondObjectContainer< Item >::getAllContainers().

◆ ~HcalRecoParamsGPU()

HcalRecoParamsGPU::~HcalRecoParamsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 29 of file HcalRecoParamsGPU.cc.

29  {
30  auto const& product =
31  product_.dataForCurrentDeviceAsync(stream, [this](HcalRecoParamsGPU::Product& product, cudaStream_t stream) {
32  // allocate
33  product.param1 = cms::cuda::make_device_unique<uint32_t[]>(param1_.size(), stream);
34  product.param2 = cms::cuda::make_device_unique<uint32_t[]>(param2_.size(), stream);
35 
36  // transfer
39  });
40 
41  return product;
42 }

References cms::cuda::copyAsync(), HcalRecoParamsGPU::Product::param1, param1_, HcalRecoParamsGPU::Product::param2, param2_, product_, and cms::cuda::stream.

Member Data Documentation

◆ param1_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > HcalRecoParamsGPU::param1_
private

Definition at line 33 of file HcalRecoParamsGPU.h.

Referenced by getProduct().

◆ param2_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > HcalRecoParamsGPU::param2_
private

Definition at line 34 of file HcalRecoParamsGPU.h.

Referenced by getProduct().

◆ product_

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

Definition at line 36 of file HcalRecoParamsGPU.h.

Referenced by getProduct().

◆ totalChannels_

uint64_t HcalRecoParamsGPU::totalChannels_
private

Definition at line 32 of file HcalRecoParamsGPU.h.

mps_fire.i
i
Definition: mps_fire.py:428
HcalRecoParamsGPU::Product::param2
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > param2
Definition: HcalRecoParamsGPU.h:18
HcalRecoParamsGPU::Product
Definition: HcalRecoParamsGPU.h:16
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
HcalRecoParamsGPU::param2_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param2_
Definition: HcalRecoParamsGPU.h:34
HcalRecoParamsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalRecoParamsGPU.h:36
HcalRecoParamsGPU::param1_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param1_
Definition: HcalRecoParamsGPU.h:33
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
HcalRecoParamsGPU::Product::param1
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > param1
Definition: HcalRecoParamsGPU.h:17
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HcalRecoParamsGPU::totalChannels_
uint64_t totalChannels_
Definition: HcalRecoParamsGPU.h:32
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20