CMS 3D CMS Logo

EcalRecHitParametersGPU.cc
Go to the documentation of this file.
2 
7 
8 EcalRecHitParametersGPU::EcalRecHitParametersGPU(std::vector<int> const& channelStatusToBeExcluded,
9  std::vector<DBStatus> const& flagsMapDBReco) {
10  channelStatusToBeExcluded_.resize(channelStatusToBeExcluded.size());
11  std::copy(channelStatusToBeExcluded.begin(), channelStatusToBeExcluded.end(), channelStatusToBeExcluded_.begin());
12 
13  for (auto const& flagInfo : flagsMapDBReco) {
14  EcalRecHit::Flags recoflagbit = static_cast<EcalRecHit::Flags>(flagInfo.recoflagbit);
15  for (auto v : flagInfo.dbstatus) {
17  expanded_v_DB_reco_flags_.push_back(dbstatus);
18  }
19 
20  expanded_Sizes_v_DB_reco_flags_.push_back(flagInfo.dbstatus.size());
21  expanded_flagbit_v_DB_reco_flags_.push_back(recoflagbit);
22  }
23 }
24 
26  auto const& product = product_.dataForCurrentDeviceAsync(
27  cudaStream, [this](EcalRecHitParametersGPU::Product& product, cudaStream_t cudaStream) {
28  // allocate
30  cms::cuda::make_device_unique<int[]>(channelStatusToBeExcluded_.size(), cudaStream);
31  product.expanded_v_DB_reco_flags =
32  cms::cuda::make_device_unique<int[]>(expanded_v_DB_reco_flags_.size(), cudaStream);
34  cms::cuda::make_device_unique<uint32_t[]>(expanded_Sizes_v_DB_reco_flags_.size(), cudaStream);
36  cms::cuda::make_device_unique<uint32_t[]>(expanded_flagbit_v_DB_reco_flags_.size(), cudaStream);
37  // transfer
42  });
43  return product;
44 }
45 
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > expanded_v_DB_reco_flags
Product const & getProduct(cudaStream_t) const
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
cms::cuda::ESProduct< Product > product_
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_Sizes_v_DB_reco_flags
EcalRecHitParametersGPU(std::vector< int > const &channelStatusToBeExcluded, std::vector< DBStatus > const &flagsMapDBReco)
channelStatusToBeExcluded must contain EcalChannelStatusCode::Code
std::vector< int, cms::cuda::HostAllocator< int > > expanded_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_Sizes_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_flagbit_v_DB_reco_flags_
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< int[]> > channelStatusToBeExcluded
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_flagbit_v_DB_reco_flags