CMS 3D CMS Logo

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

#include <EcalMultifitParametersGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalMultifitParametersGPU (edm::ParameterSet const &)
 
Product const & getProduct (cudaStream_t) const
 
std::array< std::reference_wrapper< std::vector< double, cms::cuda::HostAllocator< double > > const >, 4 > getValues () const
 
 ~EcalMultifitParametersGPU ()=default
 

Private Attributes

std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_
 
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
 
cms::cuda::ESProduct< Productproduct_
 
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEB_
 
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEE_
 

Detailed Description

Definition at line 15 of file EcalMultifitParametersGPU.h.

Constructor & Destructor Documentation

◆ EcalMultifitParametersGPU()

EcalMultifitParametersGPU::EcalMultifitParametersGPU ( edm::ParameterSet const &  ps)

Definition at line 6 of file EcalMultifitParametersGPU.cc.

6  {
7  auto const& amplitudeFitParametersEB = ps.getParameter<std::vector<double>>("EBamplitudeFitParameters");
8  auto const& amplitudeFitParametersEE = ps.getParameter<std::vector<double>>("EEamplitudeFitParameters");
9  auto const& timeFitParametersEB = ps.getParameter<std::vector<double>>("EBtimeFitParameters");
10  auto const& timeFitParametersEE = ps.getParameter<std::vector<double>>("EEtimeFitParameters");
11 
12  amplitudeFitParametersEB_.resize(amplitudeFitParametersEB.size());
13  amplitudeFitParametersEE_.resize(amplitudeFitParametersEE.size());
14  timeFitParametersEB_.resize(timeFitParametersEB.size());
15  timeFitParametersEE_.resize(timeFitParametersEE.size());
16 
17  std::copy(amplitudeFitParametersEB.begin(), amplitudeFitParametersEB.end(), amplitudeFitParametersEB_.begin());
18  std::copy(amplitudeFitParametersEE.begin(), amplitudeFitParametersEE.end(), amplitudeFitParametersEE_.begin());
19  std::copy(timeFitParametersEB.begin(), timeFitParametersEB.end(), timeFitParametersEB_.begin());
20  std::copy(timeFitParametersEE.begin(), timeFitParametersEE.end(), timeFitParametersEE_.begin());
21 }

References amplitudeFitParametersEB_, amplitudeFitParametersEE_, filterCSVwithJSON::copy, edm::ParameterSet::getParameter(), timeFitParametersEB_, and timeFitParametersEE_.

◆ ~EcalMultifitParametersGPU()

EcalMultifitParametersGPU::~EcalMultifitParametersGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 23 of file EcalMultifitParametersGPU.cc.

23  {
24  auto const& product = product_.dataForCurrentDeviceAsync(
25  cudaStream, [this](EcalMultifitParametersGPU::Product& product, cudaStream_t cudaStream) {
26  // allocate
27  product.amplitudeFitParametersEB =
28  cms::cuda::make_device_unique<double[]>(amplitudeFitParametersEB_.size(), cudaStream);
29  product.amplitudeFitParametersEE =
30  cms::cuda::make_device_unique<double[]>(amplitudeFitParametersEE_.size(), cudaStream);
31  product.timeFitParametersEB = cms::cuda::make_device_unique<double[]>(timeFitParametersEB_.size(), cudaStream);
32  product.timeFitParametersEE = cms::cuda::make_device_unique<double[]>(timeFitParametersEE_.size(), cudaStream);
33  // transfer
38  });
39  return product;
40 }

References EcalMultifitParametersGPU::Product::amplitudeFitParametersEB, amplitudeFitParametersEB_, EcalMultifitParametersGPU::Product::amplitudeFitParametersEE, amplitudeFitParametersEE_, cms::cuda::copyAsync(), product_, EcalMultifitParametersGPU::Product::timeFitParametersEB, timeFitParametersEB_, EcalMultifitParametersGPU::Product::timeFitParametersEE, and timeFitParametersEE_.

◆ getValues()

std::array<std::reference_wrapper<std::vector<double, cms::cuda::HostAllocator<double> > const>, 4> EcalMultifitParametersGPU::getValues ( ) const
inline

Member Data Documentation

◆ amplitudeFitParametersEB_

std::vector<double, cms::cuda::HostAllocator<double> > EcalMultifitParametersGPU::amplitudeFitParametersEB_
private

Definition at line 36 of file EcalMultifitParametersGPU.h.

Referenced by EcalMultifitParametersGPU(), getProduct(), and getValues().

◆ amplitudeFitParametersEE_

std::vector<double, cms::cuda::HostAllocator<double> > EcalMultifitParametersGPU::amplitudeFitParametersEE_
private

Definition at line 36 of file EcalMultifitParametersGPU.h.

Referenced by EcalMultifitParametersGPU(), getProduct(), and getValues().

◆ product_

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

Definition at line 39 of file EcalMultifitParametersGPU.h.

Referenced by getProduct().

◆ timeFitParametersEB_

std::vector<double, cms::cuda::HostAllocator<double> > EcalMultifitParametersGPU::timeFitParametersEB_
private

Definition at line 36 of file EcalMultifitParametersGPU.h.

Referenced by EcalMultifitParametersGPU(), getProduct(), and getValues().

◆ timeFitParametersEE_

std::vector<double, cms::cuda::HostAllocator<double> > EcalMultifitParametersGPU::timeFitParametersEE_
private

Definition at line 36 of file EcalMultifitParametersGPU.h.

Referenced by EcalMultifitParametersGPU(), getProduct(), and getValues().

EcalMultifitParametersGPU::timeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEE_
Definition: EcalMultifitParametersGPU.h:36
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EcalMultifitParametersGPU::Product
Definition: EcalMultifitParametersGPU.h:17
EcalMultifitParametersGPU::amplitudeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
Definition: EcalMultifitParametersGPU.h:36
EcalMultifitParametersGPU::amplitudeFitParametersEB_
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_
Definition: EcalMultifitParametersGPU.h:36
EcalMultifitParametersGPU::Product::timeFitParametersEB
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > timeFitParametersEB
Definition: EcalMultifitParametersGPU.h:20
EcalMultifitParametersGPU::Product::timeFitParametersEE
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > timeFitParametersEE
Definition: EcalMultifitParametersGPU.h:21
EcalMultifitParametersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalMultifitParametersGPU.h:39
EcalMultifitParametersGPU::Product::amplitudeFitParametersEE
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > amplitudeFitParametersEE
Definition: EcalMultifitParametersGPU.h:19
EcalMultifitParametersGPU::Product::amplitudeFitParametersEB
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > amplitudeFitParametersEB
Definition: EcalMultifitParametersGPU.h:18
EcalMultifitParametersGPU::timeFitParametersEB_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEB_
Definition: EcalMultifitParametersGPU.h:36
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20