CMS 3D CMS Logo

HcalRecoParamsGPU.cc
Go to the documentation of this file.
5 
6 // FIXME: add proper getters to conditions
8  : totalChannels_{recoParams.getAllContainers()[0].second.size() + recoParams.getAllContainers()[1].second.size()},
9  param1_(totalChannels_),
10  param2_(totalChannels_) {
11  auto const& containers = recoParams.getAllContainers();
12 
13  // fill in eb
14  auto const& barrelValues = containers[0].second;
15  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
16  param1_[i] = barrelValues[i].param1();
17  param2_[i] = barrelValues[i].param2();
18  }
19 
20  // fill in ee
21  auto const& endcapValues = containers[1].second;
22  auto const offset = barrelValues.size();
23  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
24  param1_[i + offset] = endcapValues[i].param1();
25  param2_[i + offset] = endcapValues[i].param2();
26  }
27 }
28 
30  auto const& product =
31  product_.dataForCurrentDeviceAsync(stream, [this](HcalRecoParamsGPU::Product& product, cudaStream_t stream) {
32  // allocate
33  product.param1 = cms::cuda::make_device_unique<uint32_t[]>(param1_.size(), stream);
34  product.param2 = cms::cuda::make_device_unique<uint32_t[]>(param2_.size(), stream);
35 
36  // transfer
39  });
40 
41  return product;
42 }
43 
Product const & getProduct(cudaStream_t) const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
HcalRecoParamsGPU(HcalRecoParams const &)
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param2_
cms::cuda::ESProduct< Product > product_
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< uint32_t[]> > param1
const tAllContWithNames getAllContainers() const
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
unsigned long long uint64_t
Definition: Time.h:13
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > param1_
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > param2