CMS 3D CMS Logo

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

#include <HcalChannelQualityGPU.h>

Classes

struct  Product
 

Public Member Functions

const ProductgetProduct (cudaStream_t) const
 
 HcalChannelQualityGPU (HcalChannelQuality const &)
 
 ~HcalChannelQualityGPU ()=default
 

Private Attributes

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

Detailed Description

Definition at line 13 of file HcalChannelQualityGPU.h.

Constructor & Destructor Documentation

◆ HcalChannelQualityGPU()

HcalChannelQualityGPU::HcalChannelQualityGPU ( HcalChannelQuality const &  quality)

Definition at line 7 of file HcalChannelQualityGPU.cc.

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

References quality.

◆ ~HcalChannelQualityGPU()

HcalChannelQualityGPU::~HcalChannelQualityGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 26 of file HcalChannelQualityGPU.cc.

26  {
27  auto const& product =
28  product_.dataForCurrentDeviceAsync(stream, [this](HcalChannelQualityGPU::Product& product, cudaStream_t stream) {
29  // allocate
30  product.status = cms::cuda::make_device_unique<uint32_t[]>(status_.size(), stream);
31 
32  // transfer
34 
35  });
36 
37  return product;
38 }

References cms::cuda::copyAsync(), product_, HcalChannelQualityGPU::Product::status, status_, and cms::cuda::stream.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ product_

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

Definition at line 33 of file HcalChannelQualityGPU.h.

Referenced by getProduct().

◆ status_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > HcalChannelQualityGPU::status_
private

Definition at line 31 of file HcalChannelQualityGPU.h.

Referenced by getProduct().

◆ totalChannels_

uint64_t HcalChannelQualityGPU::totalChannels_
private

Definition at line 30 of file HcalChannelQualityGPU.h.

mps_fire.i
i
Definition: mps_fire.py:428
HcalChannelQualityGPU::Product
Definition: HcalChannelQualityGPU.h:15
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
HcalChannelQualityGPU::Product::status
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > status
Definition: HcalChannelQualityGPU.h:16
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
HcalChannelQualityGPU::totalChannels_
uint64_t totalChannels_
Definition: HcalChannelQualityGPU.h:30
HcalChannelQualityGPU::status_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > status_
Definition: HcalChannelQualityGPU.h:31
HcalChannelQualityGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalChannelQualityGPU.h:33
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
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20