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.

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

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 }
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEB_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_

◆ ~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.

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

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 }
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > timeFitParametersEB
cms::cuda::ESProduct< Product > product_
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > timeFitParametersEE
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > amplitudeFitParametersEE
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEB_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEE_
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< double[]> > amplitudeFitParametersEB
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_

◆ getValues()

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

Definition at line 33 of file EcalMultifitParametersGPU.h.

References amplitudeFitParametersEB_, amplitudeFitParametersEE_, timeFitParametersEB_, and timeFitParametersEE_.

33  {
35  }
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEB_
std::vector< double, cms::cuda::HostAllocator< double > > timeFitParametersEE_
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_

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().