CMS 3D CMS Logo

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

#include <EcalPedestalsGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalPedestalsGPU (EcalPedestals const &)
 
const ProductgetProduct (cudaStream_t) const
 
 ~EcalPedestalsGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

std::vector< float, cms::cuda::HostAllocator< float > > mean_x12_
 
std::vector< float, cms::cuda::HostAllocator< float > > mean_x1_
 
std::vector< float, cms::cuda::HostAllocator< float > > mean_x6_
 
cms::cuda::ESProduct< Productproduct_
 
std::vector< float, cms::cuda::HostAllocator< float > > rms_x12_
 
std::vector< float, cms::cuda::HostAllocator< float > > rms_x1_
 
std::vector< float, cms::cuda::HostAllocator< float > > rms_x6_
 

Detailed Description

Definition at line 13 of file EcalPedestalsGPU.h.

Constructor & Destructor Documentation

◆ EcalPedestalsGPU()

EcalPedestalsGPU::EcalPedestalsGPU ( EcalPedestals const &  pedestals)

Definition at line 6 of file EcalPedestalsGPU.cc.

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 }

References EcalCondObjectContainer< T >::barrelItems(), EcalCondObjectContainer< T >::endcapItems(), mps_fire::i, mean_x12_, mean_x1_, mean_x6_, hltrates_dqm_sourceclient-live_cfg::offset, rms_x12_, rms_x1_, and rms_x6_.

◆ ~EcalPedestalsGPU()

EcalPedestalsGPU::~EcalPedestalsGPU ( )
default

Member Function Documentation

◆ getProduct()

EcalPedestalsGPU::Product const & EcalPedestalsGPU::getProduct ( cudaStream_t  cudaStream) const

Definition at line 37 of file EcalPedestalsGPU.cc.

37  {
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 }

References cms::cuda::copyAsync(), EcalPedestalsGPU::Product::mean_x1, EcalPedestalsGPU::Product::mean_x12, mean_x12_, mean_x1_, EcalPedestalsGPU::Product::mean_x6, mean_x6_, product_, EcalPedestalsGPU::Product::rms_x1, EcalPedestalsGPU::Product::rms_x12, rms_x12_, rms_x1_, EcalPedestalsGPU::Product::rms_x6, and rms_x6_.

◆ name()

static std::string EcalPedestalsGPU::name ( )
inlinestatic

Member Data Documentation

◆ mean_x12_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::mean_x12_
private

Definition at line 41 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

◆ mean_x1_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::mean_x1_
private

Definition at line 45 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

◆ mean_x6_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::mean_x6_
private

Definition at line 43 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

◆ product_

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

Definition at line 48 of file EcalPedestalsGPU.h.

Referenced by getProduct().

◆ rms_x12_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::rms_x12_
private

Definition at line 42 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

◆ rms_x1_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::rms_x1_
private

Definition at line 46 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

◆ rms_x6_

std::vector<float, cms::cuda::HostAllocator<float> > EcalPedestalsGPU::rms_x6_
private

Definition at line 44 of file EcalPedestalsGPU.h.

Referenced by EcalPedestalsGPU(), and getProduct().

EcalPedestalsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalPedestalsGPU.h:48
mps_fire.i
i
Definition: mps_fire.py:428
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::mean_x1_
std::vector< float, cms::cuda::HostAllocator< float > > mean_x1_
Definition: EcalPedestalsGPU.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalPedestalsGPU::Product::mean_x6
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > mean_x6
Definition: EcalPedestalsGPU.h:17
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
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