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 (std::vector< double > const &amplitudeEB, std::vector< double > const &amplitudeEE, std::vector< double > const &timeEB, std::vector< double > const &timeEE)
 
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 14 of file EcalMultifitParametersGPU.h.

Constructor & Destructor Documentation

◆ EcalMultifitParametersGPU()

EcalMultifitParametersGPU::EcalMultifitParametersGPU ( std::vector< double > const &  amplitudeEB,
std::vector< double > const &  amplitudeEE,
std::vector< double > const &  timeEB,
std::vector< double > const &  timeEE 
)

Definition at line 6 of file EcalMultifitParametersGPU.cc.

9  {
10  amplitudeFitParametersEB_.resize(amplitudeFitParametersEB.size());
11  amplitudeFitParametersEE_.resize(amplitudeFitParametersEE.size());
12  timeFitParametersEB_.resize(timeFitParametersEB.size());
13  timeFitParametersEE_.resize(timeFitParametersEE.size());
14 
15  std::copy(amplitudeFitParametersEB.begin(), amplitudeFitParametersEB.end(), amplitudeFitParametersEB_.begin());
16  std::copy(amplitudeFitParametersEE.begin(), amplitudeFitParametersEE.end(), amplitudeFitParametersEE_.begin());
17  std::copy(timeFitParametersEB.begin(), timeFitParametersEB.end(), timeFitParametersEB_.begin());
18  std::copy(timeFitParametersEE.begin(), timeFitParametersEE.end(), timeFitParametersEE_.begin());
19 }

References amplitudeFitParametersEB_, amplitudeFitParametersEE_, filterCSVwithJSON::copy, timeFitParametersEB_, and timeFitParametersEE_.

◆ ~EcalMultifitParametersGPU()

EcalMultifitParametersGPU::~EcalMultifitParametersGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 21 of file EcalMultifitParametersGPU.cc.

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

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 38 of file EcalMultifitParametersGPU.h.

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

◆ amplitudeFitParametersEE_

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

Definition at line 38 of file EcalMultifitParametersGPU.h.

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

◆ product_

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

Definition at line 41 of file EcalMultifitParametersGPU.h.

Referenced by getProduct().

◆ timeFitParametersEB_

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

Definition at line 38 of file EcalMultifitParametersGPU.h.

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

◆ timeFitParametersEE_

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

Definition at line 38 of file EcalMultifitParametersGPU.h.

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

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