CMS 3D CMS Logo

HcalMahiPulseOffsetsGPU.cc
Go to the documentation of this file.
2 
5 
6 // FIXME: add proper getters to conditions
8  values_.resize(values.size());
9  std::copy(values.begin(), values.end(), values_.begin());
10 }
11 
13  // deallocation
14  cudaCheck(cudaFree(values));
15 }
16 
18  auto const& product = product_.dataForCurrentDeviceAsync(
19  cudaStream, [this](HcalMahiPulseOffsetsGPU::Product& product, cudaStream_t cudaStream) {
20  // malloc
21  cudaCheck(cudaMalloc((void**)&product.values, this->values_.size() * sizeof(int)));
22 
23  // transfer
24  cudaCheck(cudaMemcpyAsync(product.values,
25  this->values_.data(),
26  this->values_.size() * sizeof(int),
27  cudaMemcpyHostToDevice,
28  cudaStream));
29  });
30 
31  return product;
32 }
33 
HcalMahiPulseOffsetsGPU(std::vector< int > const &values)
cms::cuda::ESProduct< Product > product_
Product const & getProduct(cudaStream_t) const
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
std::vector< int, cms::cuda::HostAllocator< int > > values_