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) {
16  EcalChannelStatusCode::Code dbstatus = static_cast<EcalChannelStatusCode::Code>(v);
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 
EcalRecHitParametersGPU::channelStatusToBeExcluded_
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
Definition: EcalRecHitParametersGPU.h:48
EcalRecHitParametersGPU::Product::expanded_flagbit_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_flagbit_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:20
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EcalRecHitParametersGPU::Product::expanded_Sizes_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_Sizes_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:19
EcalRecHitParametersGPU::expanded_v_DB_reco_flags_
std::vector< int, cms::cuda::HostAllocator< int > > expanded_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:49
EcalRecHit::Flags
Flags
Definition: EcalRecHit.h:20
EcalRecHitParametersGPU
Definition: EcalRecHitParametersGPU.h:14
EcalRecHitParametersGPU::expanded_Sizes_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_Sizes_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:50
typelookup.h
EcalRecHitParametersGPU::getProduct
Product const & getProduct(cudaStream_t) const
Definition: EcalRecHitParametersGPU.cc:25
findQualityFiles.v
v
Definition: findQualityFiles.py:179
EcalRecHitParametersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalRecHitParametersGPU.h:53
EcalRecHitParametersGPU::EcalRecHitParametersGPU
EcalRecHitParametersGPU(std::vector< int > const &channelStatusToBeExcluded, std::vector< DBStatus > const &flagsMapDBReco)
channelStatusToBeExcluded must contain EcalChannelStatusCode::Code
Definition: EcalRecHitParametersGPU.cc:8
EcalRecHitParametersGPU::Product
Definition: EcalRecHitParametersGPU.h:16
EcalRecHit.h
HLT_FULL_cff.flagsMapDBReco
flagsMapDBReco
Definition: HLT_FULL_cff.py:8306
EcalRecHitParametersGPU::expanded_flagbit_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_flagbit_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:50
copyAsync.h
EcalRecHitParametersGPU.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
EcalRecHitParametersGPU::Product::channelStatusToBeExcluded
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > channelStatusToBeExcluded
Definition: EcalRecHitParametersGPU.h:17
EcalRechitChannelStatusGPU.h
EcalChannelStatusCode::Code
Code
Definition: EcalChannelStatusCode.h:20
EcalRecHitParametersGPU::Product::expanded_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > expanded_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:18
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20