CMS 3D CMS Logo

HcalQIECodersGPU.cc
Go to the documentation of this file.
4 
6  : totalChannels_{qiedata.getAllContainers()[0].second.size() + qiedata.getAllContainers()[1].second.size()},
7  offsets_(totalChannels_ * numValuesPerChannel),
8  slopes_(totalChannels_ * numValuesPerChannel) {
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 }
35 
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 }
50 
mps_fire.i
i
Definition: mps_fire.py:428
HcalQIECodersGPU::getProduct
const Product & getProduct(cudaStream_t) const
Definition: HcalQIECodersGPU.cc:36
HcalQIECodersGPU::Product
Definition: HcalQIECodersGPU.h:17
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
typelookup.h
HcalQIECodersGPU::HcalQIECodersGPU
HcalQIECodersGPU(HcalQIEData const &)
Definition: HcalQIECodersGPU.cc:5
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
copyAsync.h
HcalQIECodersGPU::Product::offsets
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > offsets
Definition: HcalQIECodersGPU.h:18
HcalCondObjectContainer::getAllContainers
const tAllContWithNames getAllContainers() const
Definition: HcalCondObjectContainer.h:81
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
HcalQIEData
Definition: HcalQIEData.h:24
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
HcalQIECodersGPU.h
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
HcalQIECodersGPU
Definition: HcalQIECodersGPU.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