CMS 3D CMS Logo

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

#include <HcalTimeCorrsGPU.h>

Classes

struct  Product
 

Public Member Functions

Product const & getProduct (cudaStream_t) const
 
 HcalTimeCorrsGPU (HcalTimeCorrs const &)
 
 ~HcalTimeCorrsGPU ()=default
 

Private Attributes

cms::cuda::ESProduct< Productproduct_
 
std::vector< float, cms::cuda::HostAllocator< float > > value_
 

Detailed Description

Definition at line 13 of file HcalTimeCorrsGPU.h.

Constructor & Destructor Documentation

◆ HcalTimeCorrsGPU()

HcalTimeCorrsGPU::HcalTimeCorrsGPU ( HcalTimeCorrs const &  timecorrs)

Definition at line 7 of file HcalTimeCorrsGPU.cc.

8  : value_(timecorrs.getAllContainers()[0].second.size() + timecorrs.getAllContainers()[1].second.size()) {
9  auto const containers = timecorrs.getAllContainers();
10 
11  // fill in eb
12  auto const& barrelValues = containers[0].second;
13  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
14  value_[i] = barrelValues[i].getValue();
15  }
16 
17  // fill in ee
18  auto const& endcapValues = containers[1].second;
19  auto const offset = barrelValues.size();
20  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
21  value_[i + offset] = endcapValues[i].getValue();
22  }
23 }

References HcalCondObjectContainer< Item >::getAllContainers(), mps_fire::i, hltrates_dqm_sourceclient-live_cfg::offset, and value_.

◆ ~HcalTimeCorrsGPU()

HcalTimeCorrsGPU::~HcalTimeCorrsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 25 of file HcalTimeCorrsGPU.cc.

25  {
26  auto const& product =
27  product_.dataForCurrentDeviceAsync(stream, [this](HcalTimeCorrsGPU::Product& product, cudaStream_t stream) {
28  // allocate
29  product.value = cms::cuda::make_device_unique<float[]>(value_.size(), stream);
30 
31  // transfer
33  });
34 
35  return product;
36 }

References cms::cuda::copyAsync(), product_, cms::cuda::stream, HcalTimeCorrsGPU::Product::value, and value_.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ product_

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

Definition at line 32 of file HcalTimeCorrsGPU.h.

Referenced by getProduct().

◆ value_

std::vector<float, cms::cuda::HostAllocator<float> > HcalTimeCorrsGPU::value_
private

Definition at line 30 of file HcalTimeCorrsGPU.h.

Referenced by getProduct(), and HcalTimeCorrsGPU().

mps_fire.i
i
Definition: mps_fire.py:428
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HcalTimeCorrsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalTimeCorrsGPU.h:32
HcalTimeCorrsGPU::Product
Definition: HcalTimeCorrsGPU.h:15
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HcalTimeCorrsGPU::Product::value
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > value
Definition: HcalTimeCorrsGPU.h:16
HcalTimeCorrsGPU::value_
std::vector< float, cms::cuda::HostAllocator< float > > value_
Definition: HcalTimeCorrsGPU.h:30
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20