CMS 3D CMS Logo

EcalTimeCalibConstantsGPU.cc
Go to the documentation of this file.
2 
5 
7  values_.reserve(values.size());
8  for (size_t i = 0; i < values.size(); ++i) {
9  values_.emplace_back(values[i]);
10  }
11  offset_ = values.barrelItems().size();
12 }
13 
15  auto const& product = product_.dataForCurrentDeviceAsync(
16  cudaStream, [this](EcalTimeCalibConstantsGPU::Product& product, cudaStream_t cudaStream) {
17  // allocate
18  product.values = cms::cuda::make_device_unique<float[]>(values_.size(), cudaStream);
19  // transfer
20  cms::cuda::copyAsync(product.values, values_, cudaStream);
21  });
22 
23  return product;
24 }
25 
Product const & getProduct(cudaStream_t) const
std::vector< float, cms::cuda::HostAllocator< float > > values_
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[]> > values
EcalTimeCalibConstantsGPU(EcalTimeCalibConstants const &)
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
cms::cuda::ESProduct< Product > product_