CMS 3D CMS Logo

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

#include <EcalTimeBiasCorrectionsGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalTimeBiasCorrectionsGPU (EcalTimeBiasCorrections const &)
 
Product const & getProduct (cudaStream_t) const
 
 ~EcalTimeBiasCorrectionsGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrAmplitudeBins_
 
std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrShiftBins_
 
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrAmplitudeBins_
 
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrShiftBins_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 13 of file EcalTimeBiasCorrectionsGPU.h.

Constructor & Destructor Documentation

◆ EcalTimeBiasCorrectionsGPU()

EcalTimeBiasCorrectionsGPU::EcalTimeBiasCorrectionsGPU ( EcalTimeBiasCorrections const &  values)

Definition at line 6 of file EcalTimeBiasCorrectionsGPU.cc.

References ebTimeCorrAmplitudeBins_, ebTimeCorrShiftBins_, eeTimeCorrAmplitudeBins_, eeTimeCorrShiftBins_, and contentValuesCheck::values.

6  {
7  ebTimeCorrAmplitudeBins_.reserve(values.EBTimeCorrAmplitudeBins.size());
8  for (const auto& ebTimeCorrAmplitudeBin : values.EBTimeCorrAmplitudeBins) {
9  ebTimeCorrAmplitudeBins_.emplace_back(ebTimeCorrAmplitudeBin);
10  }
11 
12  ebTimeCorrShiftBins_.reserve(values.EBTimeCorrAmplitudeBins.size());
13  for (const auto& ebTimeCorrShiftBin : values.EBTimeCorrShiftBins) {
14  ebTimeCorrShiftBins_.emplace_back(ebTimeCorrShiftBin);
15  }
16 
17  eeTimeCorrAmplitudeBins_.reserve(values.EETimeCorrAmplitudeBins.size());
18  for (const auto& eeTimeCorrAmplitudeBin : values.EETimeCorrAmplitudeBins) {
19  eeTimeCorrAmplitudeBins_.emplace_back(eeTimeCorrAmplitudeBin);
20  }
21 
22  eeTimeCorrShiftBins_.reserve(values.EETimeCorrAmplitudeBins.size());
23  for (const auto& eeTimeCorrShiftBin : values.EETimeCorrShiftBins) {
24  eeTimeCorrShiftBins_.emplace_back(eeTimeCorrShiftBin);
25  }
26 }
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrAmplitudeBins_
std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrAmplitudeBins_
std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrShiftBins_
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrShiftBins_

◆ ~EcalTimeBiasCorrectionsGPU()

EcalTimeBiasCorrectionsGPU::~EcalTimeBiasCorrectionsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 28 of file EcalTimeBiasCorrectionsGPU.cc.

References cms::cuda::copyAsync(), EcalTimeBiasCorrectionsGPU::Product::ebTimeCorrAmplitudeBins, ebTimeCorrAmplitudeBins_, EcalTimeBiasCorrectionsGPU::Product::ebTimeCorrAmplitudeBinsSize, EcalTimeBiasCorrectionsGPU::Product::ebTimeCorrShiftBins, ebTimeCorrShiftBins_, EcalTimeBiasCorrectionsGPU::Product::eeTimeCorrAmplitudeBins, eeTimeCorrAmplitudeBins_, EcalTimeBiasCorrectionsGPU::Product::eeTimeCorrAmplitudeBinsSize, EcalTimeBiasCorrectionsGPU::Product::eeTimeCorrShiftBins, eeTimeCorrShiftBins_, and product_.

28  {
29  auto const& product = product_.dataForCurrentDeviceAsync(
30  cudaStream, [this](EcalTimeBiasCorrectionsGPU::Product& product, cudaStream_t cudaStream) {
31  // to get the size of vectors later on
32  // should be removed and host conditions' objects used directly
35 
36  // allocate
37  product.ebTimeCorrAmplitudeBins =
38  cms::cuda::make_device_unique<float[]>(ebTimeCorrAmplitudeBins_.size(), cudaStream);
39  product.ebTimeCorrShiftBins = cms::cuda::make_device_unique<float[]>(ebTimeCorrShiftBins_.size(), cudaStream);
40  product.eeTimeCorrAmplitudeBins =
41  cms::cuda::make_device_unique<float[]>(eeTimeCorrAmplitudeBins_.size(), cudaStream);
42  product.eeTimeCorrShiftBins = cms::cuda::make_device_unique<float[]>(eeTimeCorrShiftBins_.size(), cudaStream);
43  // transfer
48  });
49 
50  return product;
51 }
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > eeTimeCorrShiftBins
cms::cuda::ESProduct< Product > product_
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrAmplitudeBins_
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > ebTimeCorrAmplitudeBins
std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrAmplitudeBins_
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > eeTimeCorrAmplitudeBins
std::vector< float, cms::cuda::HostAllocator< float > > ebTimeCorrShiftBins_
std::vector< float, cms::cuda::HostAllocator< float > > eeTimeCorrShiftBins_
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > ebTimeCorrShiftBins

◆ name()

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

Member Data Documentation

◆ ebTimeCorrAmplitudeBins_

std::vector<float, cms::cuda::HostAllocator<float> > EcalTimeBiasCorrectionsGPU::ebTimeCorrAmplitudeBins_
private

Definition at line 39 of file EcalTimeBiasCorrectionsGPU.h.

Referenced by EcalTimeBiasCorrectionsGPU(), and getProduct().

◆ ebTimeCorrShiftBins_

std::vector<float, cms::cuda::HostAllocator<float> > EcalTimeBiasCorrectionsGPU::ebTimeCorrShiftBins_
private

Definition at line 40 of file EcalTimeBiasCorrectionsGPU.h.

Referenced by EcalTimeBiasCorrectionsGPU(), and getProduct().

◆ eeTimeCorrAmplitudeBins_

std::vector<float, cms::cuda::HostAllocator<float> > EcalTimeBiasCorrectionsGPU::eeTimeCorrAmplitudeBins_
private

Definition at line 41 of file EcalTimeBiasCorrectionsGPU.h.

Referenced by EcalTimeBiasCorrectionsGPU(), and getProduct().

◆ eeTimeCorrShiftBins_

std::vector<float, cms::cuda::HostAllocator<float> > EcalTimeBiasCorrectionsGPU::eeTimeCorrShiftBins_
private

Definition at line 42 of file EcalTimeBiasCorrectionsGPU.h.

Referenced by EcalTimeBiasCorrectionsGPU(), and getProduct().

◆ product_

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

Definition at line 45 of file EcalTimeBiasCorrectionsGPU.h.

Referenced by getProduct().