CMS 3D CMS Logo

EcalPedestalsGPU.cc
Go to the documentation of this file.
2 
5 
7  : mean_x12_(pedestals.size()),
8  rms_x12_(pedestals.size()),
9  mean_x6_(pedestals.size()),
10  rms_x6_(pedestals.size()),
11  mean_x1_(pedestals.size()),
12  rms_x1_(pedestals.size()) {
13  // fill in eb
14  auto const& barrelValues = pedestals.barrelItems();
15  for (unsigned int i = 0; i < barrelValues.size(); i++) {
16  mean_x12_[i] = barrelValues[i].mean_x12;
17  rms_x12_[i] = barrelValues[i].rms_x12;
18  mean_x6_[i] = barrelValues[i].mean_x6;
19  rms_x6_[i] = barrelValues[i].rms_x6;
20  mean_x1_[i] = barrelValues[i].mean_x1;
21  rms_x1_[i] = barrelValues[i].rms_x1;
22  }
23 
24  // fill in ee
25  auto const& endcapValues = pedestals.endcapItems();
26  auto const offset = barrelValues.size();
27  for (unsigned int i = 0; i < endcapValues.size(); i++) {
28  mean_x12_[offset + i] = endcapValues[i].mean_x12;
29  rms_x12_[offset + i] = endcapValues[i].rms_x12;
30  mean_x6_[offset + i] = endcapValues[i].mean_x6;
31  rms_x6_[offset + i] = endcapValues[i].rms_x6;
32  mean_x1_[offset + i] = endcapValues[i].mean_x1;
33  rms_x1_[offset + i] = endcapValues[i].rms_x1;
34  }
35 }
36 
37 EcalPedestalsGPU::Product const& EcalPedestalsGPU::getProduct(cudaStream_t cudaStream) const {
38  auto const& product = product_.dataForCurrentDeviceAsync(
39  cudaStream, [this](EcalPedestalsGPU::Product& product, cudaStream_t cudaStream) {
40  // allocate
41  product.mean_x12 = cms::cuda::make_device_unique<float[]>(mean_x12_.size(), cudaStream);
42  product.mean_x6 = cms::cuda::make_device_unique<float[]>(mean_x6_.size(), cudaStream);
43  product.mean_x1 = cms::cuda::make_device_unique<float[]>(mean_x1_.size(), cudaStream);
44  product.rms_x12 = cms::cuda::make_device_unique<float[]>(rms_x12_.size(), cudaStream);
45  product.rms_x6 = cms::cuda::make_device_unique<float[]>(rms_x6_.size(), cudaStream);
46  product.rms_x1 = cms::cuda::make_device_unique<float[]>(rms_x1_.size(), cudaStream);
47  // transfer
48  cms::cuda::copyAsync(product.mean_x12, mean_x12_, cudaStream);
49  cms::cuda::copyAsync(product.mean_x6, mean_x6_, cudaStream);
50  cms::cuda::copyAsync(product.mean_x1, mean_x1_, cudaStream);
51  cms::cuda::copyAsync(product.rms_x12, rms_x12_, cudaStream);
52  cms::cuda::copyAsync(product.rms_x6, rms_x6_, cudaStream);
53  cms::cuda::copyAsync(product.rms_x1, rms_x1_, cudaStream);
54  });
55 
56  return product;
57 }
58 
EcalPedestalsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalPedestalsGPU.h:48
mps_fire.i
i
Definition: mps_fire.py:428
EcalCondObjectContainer::endcapItems
const Items & endcapItems() const
Definition: EcalCondObjectContainer.h:32
EcalPedestalsGPU.h
typelookup.h
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalPedestalsGPU::EcalPedestalsGPU
EcalPedestalsGPU(EcalPedestals const &)
Definition: EcalPedestalsGPU.cc:6
EcalPedestalsGPU::Product::rms_x1
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > rms_x1
Definition: EcalPedestalsGPU.h:21
EcalPedestalsGPU::mean_x12_
std::vector< float, cms::cuda::HostAllocator< float > > mean_x12_
Definition: EcalPedestalsGPU.h:41
EcalPedestalsGPU::rms_x6_
std::vector< float, cms::cuda::HostAllocator< float > > rms_x6_
Definition: EcalPedestalsGPU.h:44
EcalPedestalsGPU
Definition: EcalPedestalsGPU.h:13
EcalPedestalsGPU::getProduct
const Product & getProduct(cudaStream_t) const
Definition: EcalPedestalsGPU.cc:37
EcalPedestalsGPU::mean_x1_
std::vector< float, cms::cuda::HostAllocator< float > > mean_x1_
Definition: EcalPedestalsGPU.h:45
EcalCondObjectContainer::barrelItems
const Items & barrelItems() const
Definition: EcalCondObjectContainer.h:30
EcalPedestalsGPU::Product::mean_x6
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > mean_x6
Definition: EcalPedestalsGPU.h:17
copyAsync.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
EcalPedestalsGPU::Product::mean_x12
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > mean_x12
Definition: EcalPedestalsGPU.h:16
EcalPedestalsGPU::mean_x6_
std::vector< float, cms::cuda::HostAllocator< float > > mean_x6_
Definition: EcalPedestalsGPU.h:43
EcalPedestalsGPU::Product
Definition: EcalPedestalsGPU.h:15
EcalPedestalsGPU::Product::rms_x12
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > rms_x12
Definition: EcalPedestalsGPU.h:19
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
EcalPedestalsGPU::Product::mean_x1
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > mean_x1
Definition: EcalPedestalsGPU.h:18
EcalPedestalsGPU::rms_x1_
std::vector< float, cms::cuda::HostAllocator< float > > rms_x1_
Definition: EcalPedestalsGPU.h:46
EcalPedestalsGPU::Product::rms_x6
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > rms_x6
Definition: EcalPedestalsGPU.h:20
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
EcalPedestalsGPU::rms_x12_
std::vector< float, cms::cuda::HostAllocator< float > > rms_x12_
Definition: EcalPedestalsGPU.h:42