CMS 3D CMS Logo

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

#include <HcalPedestalWidthsGPU.h>

Classes

struct  Product
 

Public Member Functions

Product const & getProduct (cudaStream_t) const
 
 HcalPedestalWidthsGPU (HcalPedestalWidths const &)
 
bool unitIsADC () const
 
 ~HcalPedestalWidthsGPU ()=default
 

Private Attributes

cms::cuda::ESProduct< Productproduct_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma00_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma01_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma02_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma03_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma10_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma11_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma12_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma13_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma20_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma21_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma22_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma23_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma30_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma31_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma32_
 
std::vector< float, cms::cuda::HostAllocator< float > > sigma33_
 
uint64_t totalChannels_
 
bool unitIsADC_
 

Detailed Description

Definition at line 13 of file HcalPedestalWidthsGPU.h.

Constructor & Destructor Documentation

◆ HcalPedestalWidthsGPU()

HcalPedestalWidthsGPU::HcalPedestalWidthsGPU ( HcalPedestalWidths const &  pedestals)

Definition at line 7 of file HcalPedestalWidthsGPU.cc.

8  : unitIsADC_{pedestals.isADC()},
9  totalChannels_{pedestals.getAllContainers()[0].second.size() + pedestals.getAllContainers()[1].second.size()},
26  auto const containers = pedestals.getAllContainers();
27 
28  // fill in hb
29  auto const& barrelValues = containers[0].second;
30  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
31  sigma00_[i] = *(barrelValues[i].getValues() /* + 0 */);
32  sigma01_[i] = *(barrelValues[i].getValues() + 1);
33  sigma02_[i] = *(barrelValues[i].getValues() + 2);
34  sigma03_[i] = *(barrelValues[i].getValues() + 3);
35  sigma10_[i] = *(barrelValues[i].getValues() + 3);
36  sigma11_[i] = *(barrelValues[i].getValues() + 5);
37  sigma12_[i] = *(barrelValues[i].getValues() + 6);
38  sigma13_[i] = *(barrelValues[i].getValues() + 7);
39  sigma20_[i] = *(barrelValues[i].getValues() + 8);
40  sigma21_[i] = *(barrelValues[i].getValues() + 9);
41  sigma22_[i] = *(barrelValues[i].getValues() + 10);
42  sigma23_[i] = *(barrelValues[i].getValues() + 11);
43  sigma30_[i] = *(barrelValues[i].getValues() + 12);
44  sigma31_[i] = *(barrelValues[i].getValues() + 13);
45  sigma32_[i] = *(barrelValues[i].getValues() + 14);
46  sigma33_[i] = *(barrelValues[i].getValues() + 15);
47  }
48 
49  // fill in he
50  auto const& endcapValues = containers[1].second;
51  auto const offset = barrelValues.size();
52  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
53  sigma00_[i + offset] = *(endcapValues[i].getValues() /* + 0 */);
54  sigma01_[i + offset] = *(endcapValues[i].getValues() + 1);
55  sigma02_[i + offset] = *(endcapValues[i].getValues() + 2);
56  sigma03_[i + offset] = *(endcapValues[i].getValues() + 3);
57  sigma10_[i + offset] = *(endcapValues[i].getValues() + 3);
58  sigma11_[i + offset] = *(endcapValues[i].getValues() + 5);
59  sigma12_[i + offset] = *(endcapValues[i].getValues() + 6);
60  sigma13_[i + offset] = *(endcapValues[i].getValues() + 7);
61  sigma20_[i + offset] = *(endcapValues[i].getValues() + 8);
62  sigma21_[i + offset] = *(endcapValues[i].getValues() + 9);
63  sigma22_[i + offset] = *(endcapValues[i].getValues() + 10);
64  sigma23_[i + offset] = *(endcapValues[i].getValues() + 11);
65  sigma30_[i + offset] = *(endcapValues[i].getValues() + 12);
66  sigma31_[i + offset] = *(endcapValues[i].getValues() + 13);
67  sigma32_[i + offset] = *(endcapValues[i].getValues() + 14);
68  sigma33_[i + offset] = *(endcapValues[i].getValues() + 15);
69  }
70 }

References HcalPedestalWidths::isADC().

◆ ~HcalPedestalWidthsGPU()

HcalPedestalWidthsGPU::~HcalPedestalWidthsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 72 of file HcalPedestalWidthsGPU.cc.

72  {
73  auto const& product =
74  product_.dataForCurrentDeviceAsync(stream, [this](HcalPedestalWidthsGPU::Product& product, cudaStream_t stream) {
75  // allocate
76  product.sigma00 = cms::cuda::make_device_unique<float[]>(sigma00_.size(), stream);
77  product.sigma01 = cms::cuda::make_device_unique<float[]>(sigma01_.size(), stream);
78  product.sigma02 = cms::cuda::make_device_unique<float[]>(sigma02_.size(), stream);
79  product.sigma03 = cms::cuda::make_device_unique<float[]>(sigma03_.size(), stream);
80 
81  product.sigma10 = cms::cuda::make_device_unique<float[]>(sigma10_.size(), stream);
82  product.sigma11 = cms::cuda::make_device_unique<float[]>(sigma11_.size(), stream);
83  product.sigma12 = cms::cuda::make_device_unique<float[]>(sigma12_.size(), stream);
84  product.sigma13 = cms::cuda::make_device_unique<float[]>(sigma13_.size(), stream);
85 
86  product.sigma20 = cms::cuda::make_device_unique<float[]>(sigma20_.size(), stream);
87  product.sigma21 = cms::cuda::make_device_unique<float[]>(sigma21_.size(), stream);
88  product.sigma22 = cms::cuda::make_device_unique<float[]>(sigma22_.size(), stream);
89  product.sigma23 = cms::cuda::make_device_unique<float[]>(sigma23_.size(), stream);
90 
91  product.sigma30 = cms::cuda::make_device_unique<float[]>(sigma30_.size(), stream);
92  product.sigma31 = cms::cuda::make_device_unique<float[]>(sigma31_.size(), stream);
93  product.sigma32 = cms::cuda::make_device_unique<float[]>(sigma32_.size(), stream);
94  product.sigma33 = cms::cuda::make_device_unique<float[]>(sigma33_.size(), stream);
95 
96  // transfer
101 
106 
111 
116  });
117 
118  return product;
119 }

References cms::cuda::copyAsync(), product_, HcalPedestalWidthsGPU::Product::sigma00, sigma00_, HcalPedestalWidthsGPU::Product::sigma01, sigma01_, HcalPedestalWidthsGPU::Product::sigma02, sigma02_, HcalPedestalWidthsGPU::Product::sigma03, sigma03_, HcalPedestalWidthsGPU::Product::sigma10, sigma10_, HcalPedestalWidthsGPU::Product::sigma11, sigma11_, HcalPedestalWidthsGPU::Product::sigma12, sigma12_, HcalPedestalWidthsGPU::Product::sigma13, sigma13_, HcalPedestalWidthsGPU::Product::sigma20, sigma20_, HcalPedestalWidthsGPU::Product::sigma21, sigma21_, HcalPedestalWidthsGPU::Product::sigma22, sigma22_, HcalPedestalWidthsGPU::Product::sigma23, sigma23_, HcalPedestalWidthsGPU::Product::sigma30, sigma30_, HcalPedestalWidthsGPU::Product::sigma31, sigma31_, HcalPedestalWidthsGPU::Product::sigma32, sigma32_, HcalPedestalWidthsGPU::Product::sigma33, sigma33_, and cms::cuda::stream.

◆ unitIsADC()

bool HcalPedestalWidthsGPU::unitIsADC ( ) const
inline

Definition at line 45 of file HcalPedestalWidthsGPU.h.

45 { return unitIsADC_; }

References unitIsADC_.

Member Data Documentation

◆ product_

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

Definition at line 67 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma00_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma00_
private

Definition at line 50 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma01_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma01_
private

Definition at line 51 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma02_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma02_
private

Definition at line 52 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma03_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma03_
private

Definition at line 53 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma10_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma10_
private

Definition at line 54 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma11_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma11_
private

Definition at line 55 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma12_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma12_
private

Definition at line 56 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma13_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma13_
private

Definition at line 57 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma20_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma20_
private

Definition at line 58 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma21_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma21_
private

Definition at line 59 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma22_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma22_
private

Definition at line 60 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma23_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma23_
private

Definition at line 61 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma30_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma30_
private

Definition at line 62 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma31_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma31_
private

Definition at line 63 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma32_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma32_
private

Definition at line 64 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ sigma33_

std::vector<float, cms::cuda::HostAllocator<float> > HcalPedestalWidthsGPU::sigma33_
private

Definition at line 65 of file HcalPedestalWidthsGPU.h.

Referenced by getProduct().

◆ totalChannels_

uint64_t HcalPedestalWidthsGPU::totalChannels_
private

Definition at line 49 of file HcalPedestalWidthsGPU.h.

◆ unitIsADC_

bool HcalPedestalWidthsGPU::unitIsADC_
private

Definition at line 48 of file HcalPedestalWidthsGPU.h.

Referenced by unitIsADC().

HcalPedestalWidthsGPU::Product::sigma32
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma32
Definition: HcalPedestalWidthsGPU.h:30
mps_fire.i
i
Definition: mps_fire.py:428
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HcalPedestalWidthsGPU::sigma21_
std::vector< float, cms::cuda::HostAllocator< float > > sigma21_
Definition: HcalPedestalWidthsGPU.h:59
HcalPedestalWidthsGPU::Product::sigma13
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma13
Definition: HcalPedestalWidthsGPU.h:23
HcalPedestalWidthsGPU::Product::sigma22
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma22
Definition: HcalPedestalWidthsGPU.h:26
HcalPedestalWidthsGPU::Product::sigma11
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma11
Definition: HcalPedestalWidthsGPU.h:21
HcalPedestalWidthsGPU::sigma00_
std::vector< float, cms::cuda::HostAllocator< float > > sigma00_
Definition: HcalPedestalWidthsGPU.h:50
HcalPedestalWidthsGPU::sigma13_
std::vector< float, cms::cuda::HostAllocator< float > > sigma13_
Definition: HcalPedestalWidthsGPU.h:57
HcalPedestalWidthsGPU::sigma32_
std::vector< float, cms::cuda::HostAllocator< float > > sigma32_
Definition: HcalPedestalWidthsGPU.h:64
HcalPedestalWidthsGPU::Product::sigma20
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma20
Definition: HcalPedestalWidthsGPU.h:24
HcalPedestalWidthsGPU::sigma31_
std::vector< float, cms::cuda::HostAllocator< float > > sigma31_
Definition: HcalPedestalWidthsGPU.h:63
HcalPedestalWidthsGPU::Product::sigma03
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma03
Definition: HcalPedestalWidthsGPU.h:19
HcalPedestalWidthsGPU::Product
Definition: HcalPedestalWidthsGPU.h:15
HcalPedestalWidthsGPU::sigma01_
std::vector< float, cms::cuda::HostAllocator< float > > sigma01_
Definition: HcalPedestalWidthsGPU.h:51
HcalPedestalWidthsGPU::sigma03_
std::vector< float, cms::cuda::HostAllocator< float > > sigma03_
Definition: HcalPedestalWidthsGPU.h:53
HcalPedestalWidthsGPU::Product::sigma21
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma21
Definition: HcalPedestalWidthsGPU.h:25
HcalPedestalWidthsGPU::sigma10_
std::vector< float, cms::cuda::HostAllocator< float > > sigma10_
Definition: HcalPedestalWidthsGPU.h:54
HcalPedestalWidthsGPU::sigma02_
std::vector< float, cms::cuda::HostAllocator< float > > sigma02_
Definition: HcalPedestalWidthsGPU.h:52
HcalPedestalWidthsGPU::sigma33_
std::vector< float, cms::cuda::HostAllocator< float > > sigma33_
Definition: HcalPedestalWidthsGPU.h:65
HcalPedestalWidthsGPU::sigma11_
std::vector< float, cms::cuda::HostAllocator< float > > sigma11_
Definition: HcalPedestalWidthsGPU.h:55
HcalPedestalWidthsGPU::Product::sigma33
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma33
Definition: HcalPedestalWidthsGPU.h:31
HcalPedestalWidthsGPU::sigma30_
std::vector< float, cms::cuda::HostAllocator< float > > sigma30_
Definition: HcalPedestalWidthsGPU.h:62
HcalPedestalWidthsGPU::Product::sigma23
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma23
Definition: HcalPedestalWidthsGPU.h:27
HcalPedestalWidthsGPU::totalChannels_
uint64_t totalChannels_
Definition: HcalPedestalWidthsGPU.h:49
HcalPedestalWidthsGPU::Product::sigma12
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma12
Definition: HcalPedestalWidthsGPU.h:22
HcalPedestalWidthsGPU::sigma20_
std::vector< float, cms::cuda::HostAllocator< float > > sigma20_
Definition: HcalPedestalWidthsGPU.h:58
HcalPedestalWidthsGPU::sigma22_
std::vector< float, cms::cuda::HostAllocator< float > > sigma22_
Definition: HcalPedestalWidthsGPU.h:60
HcalPedestalWidthsGPU::Product::sigma10
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma10
Definition: HcalPedestalWidthsGPU.h:20
HcalPedestalWidthsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalPedestalWidthsGPU.h:67
HcalPedestalWidthsGPU::Product::sigma30
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma30
Definition: HcalPedestalWidthsGPU.h:28
HcalPedestalWidthsGPU::unitIsADC_
bool unitIsADC_
Definition: HcalPedestalWidthsGPU.h:48
HcalPedestalWidthsGPU::sigma23_
std::vector< float, cms::cuda::HostAllocator< float > > sigma23_
Definition: HcalPedestalWidthsGPU.h:61
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
HcalPedestalWidthsGPU::Product::sigma31
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma31
Definition: HcalPedestalWidthsGPU.h:29
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HcalPedestalWidthsGPU::Product::sigma01
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma01
Definition: HcalPedestalWidthsGPU.h:17
HcalPedestalWidthsGPU::Product::sigma02
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma02
Definition: HcalPedestalWidthsGPU.h:18
HcalPedestalWidthsGPU::sigma12_
std::vector< float, cms::cuda::HostAllocator< float > > sigma12_
Definition: HcalPedestalWidthsGPU.h:56
HcalPedestalWidthsGPU::Product::sigma00
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > sigma00
Definition: HcalPedestalWidthsGPU.h:16
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20