CMS 3D CMS Logo

EcalMultifitParametersGPU.cc
Go to the documentation of this file.
2 
5 
6 EcalMultifitParametersGPU::EcalMultifitParametersGPU(std::vector<double> const& amplitudeFitParametersEB,
7  std::vector<double> const& amplitudeFitParametersEE,
8  std::vector<double> const& timeFitParametersEB,
9  std::vector<double> const& timeFitParametersEE) {
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 }
20 
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 }
39 
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEE_
edm::propagate_const_array< cms::cuda::device::unique_ptr< double[]> > timeFitParametersEB
cms::cuda::ESProduct< Product > product_
Product const & getProduct(cudaStream_t) const
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
EcalMultifitParametersGPU(std::vector< double > const &amplitudeEB, std::vector< double > const &amplitudeEE, std::vector< double > const &timeEB, std::vector< double > const &timeEE)
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
std::vector< double, cms::cuda::HostAllocator< double > > amplitudeFitParametersEB_