CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EcalLaserAlphasGPU.cc
Go to the documentation of this file.
2 
5 
7  values_.reserve(values.size());
8  values_.insert(values_.end(), values.barrelItems().begin(), values.barrelItems().end());
9  values_.insert(values_.end(), values.endcapItems().begin(), values.endcapItems().end());
10  offset_ = values.barrelItems().size();
11 }
12 
13 EcalLaserAlphasGPU::Product const& EcalLaserAlphasGPU::getProduct(cudaStream_t cudaStream) const {
14  auto const& product = product_.dataForCurrentDeviceAsync(
15  cudaStream, [this](EcalLaserAlphasGPU::Product& product, cudaStream_t cudaStream) {
16  // allocate
17  product.values = cms::cuda::make_device_unique<float[]>(values_.size(), cudaStream);
18  // transfer
19  cms::cuda::copyAsync(product.values, values_, cudaStream);
20  });
21 
22  return product;
23 }
24 
const Items & barrelItems() const
Product const & getProduct(cudaStream_t) const
EcalLaserAlphasGPU(EcalLaserAlphas const &)
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
cms::cuda::ESProduct< Product > product_
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
std::vector< float, cms::cuda::HostAllocator< float > > values_
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > values
const Items & endcapItems() const