CMS 3D CMS Logo

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

#include <HcalQIECodersGPU.h>

Classes

struct  Product
 

Public Member Functions

const ProductgetProduct (cudaStream_t) const
 
 HcalQIECodersGPU (HcalQIEData const &)
 
 ~HcalQIECodersGPU ()=default
 

Static Public Attributes

static constexpr uint32_t numValuesPerChannel = 16
 

Private Attributes

std::vector< float, cms::cuda::HostAllocator< float > > offsets_
 
cms::cuda::ESProduct< Productproduct_
 
std::vector< float, cms::cuda::HostAllocator< float > > slopes_
 
uint64_t totalChannels_
 

Detailed Description

Definition at line 13 of file HcalQIECodersGPU.h.

Constructor & Destructor Documentation

◆ HcalQIECodersGPU()

HcalQIECodersGPU::HcalQIECodersGPU ( HcalQIEData const &  qiedata)

Definition at line 5 of file HcalQIECodersGPU.cc.

6  : totalChannels_{qiedata.getAllContainers()[0].second.size() + qiedata.getAllContainers()[1].second.size()},
9  auto const containers = qiedata.getAllContainers();
10 
11  // fill in hb
12  auto const& barrelValues = containers[0].second;
13  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
14  for (uint32_t k = 0; k < 4; k++)
15  for (uint32_t l = 0; l < 4; l++) {
16  auto const linear = k * 4 + l;
17  offsets_[i * numValuesPerChannel + linear] = barrelValues[i].offset(k, l);
18  slopes_[i * numValuesPerChannel + linear] = barrelValues[i].slope(k, l);
19  }
20  }
21 
22  // fill in he
23  auto const& endcapValues = containers[1].second;
24  auto const offset = barrelValues.size();
25  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
26  auto const off = (i + offset) * numValuesPerChannel;
27  for (uint32_t k = 0; k < 4; k++)
28  for (uint32_t l = 0; l < 4; l++) {
29  auto const linear = k * 4u + l;
30  offsets_[off + linear] = endcapValues[i].offset(k, l);
31  slopes_[off + linear] = endcapValues[i].slope(k, l);
32  }
33  }
34 }

References HcalCondObjectContainer< Item >::getAllContainers().

◆ ~HcalQIECodersGPU()

HcalQIECodersGPU::~HcalQIECodersGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 36 of file HcalQIECodersGPU.cc.

36  {
37  auto const& product =
38  product_.dataForCurrentDeviceAsync(stream, [this](HcalQIECodersGPU::Product& product, cudaStream_t stream) {
39  // allocate
40  product.offsets = cms::cuda::make_device_unique<float[]>(offsets_.size(), stream);
41  product.slopes = cms::cuda::make_device_unique<float[]>(slopes_.size(), stream);
42 
43  // transfer
46  });
47 
48  return product;
49 }

References cms::cuda::copyAsync(), HcalQIECodersGPU::Product::offsets, offsets_, product_, HcalQIECodersGPU::Product::slopes, slopes_, and cms::cuda::stream.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ numValuesPerChannel

constexpr uint32_t HcalQIECodersGPU::numValuesPerChannel = 16
staticconstexpr

Definition at line 15 of file HcalQIECodersGPU.h.

◆ offsets_

std::vector<float, cms::cuda::HostAllocator<float> > HcalQIECodersGPU::offsets_
private

Definition at line 34 of file HcalQIECodersGPU.h.

Referenced by getProduct().

◆ product_

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

Definition at line 37 of file HcalQIECodersGPU.h.

Referenced by getProduct().

◆ slopes_

std::vector<float, cms::cuda::HostAllocator<float> > HcalQIECodersGPU::slopes_
private

Definition at line 35 of file HcalQIECodersGPU.h.

Referenced by getProduct().

◆ totalChannels_

uint64_t HcalQIECodersGPU::totalChannels_
private

Definition at line 33 of file HcalQIECodersGPU.h.

mps_fire.i
i
Definition: mps_fire.py:428
HcalQIECodersGPU::Product
Definition: HcalQIECodersGPU.h:17
HcalQIECodersGPU::totalChannels_
uint64_t totalChannels_
Definition: HcalQIECodersGPU.h:33
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HcalQIECodersGPU::slopes_
std::vector< float, cms::cuda::HostAllocator< float > > slopes_
Definition: HcalQIECodersGPU.h:35
HcalQIECodersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalQIECodersGPU.h:37
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HcalQIECodersGPU::numValuesPerChannel
static constexpr uint32_t numValuesPerChannel
Definition: HcalQIECodersGPU.h:15
HcalQIECodersGPU::Product::offsets
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > offsets
Definition: HcalQIECodersGPU.h:18
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
linear
float linear(float x)
Definition: OccupancyPlotMacros.cc:26
HcalQIECodersGPU::offsets_
std::vector< float, cms::cuda::HostAllocator< float > > offsets_
Definition: HcalQIECodersGPU.h:34
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
HcalQIECodersGPU::Product::slopes
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > slopes
Definition: HcalQIECodersGPU.h:19
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20