CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
EcalRecHitParametersGPU Class Reference

#include <EcalRecHitParametersGPU.h>

Classes

struct  Product
 

Public Types

using intvec = std::reference_wrapper< std::vector< int, cms::cuda::HostAllocator< int > > const >
 
using uint32vec = std::reference_wrapper< std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > const >
 

Public Member Functions

 EcalRecHitParametersGPU (edm::ParameterSet const &)
 
const ProductgetProduct (cudaStream_t) const
 
std::tuple< intvec, intvec, uint32vec, uint32vecgetValues () const
 
 ~EcalRecHitParametersGPU ()=default
 

Private Attributes

std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
 
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_flagbit_v_DB_reco_flags_
 
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_Sizes_v_DB_reco_flags_
 
std::vector< int, cms::cuda::HostAllocator< int > > expanded_v_DB_reco_flags_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 15 of file EcalRecHitParametersGPU.h.

Member Typedef Documentation

◆ intvec

using EcalRecHitParametersGPU::intvec = std::reference_wrapper<std::vector<int, cms::cuda::HostAllocator<int> > const>

Definition at line 31 of file EcalRecHitParametersGPU.h.

◆ uint32vec

using EcalRecHitParametersGPU::uint32vec = std::reference_wrapper<std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > const>

Definition at line 32 of file EcalRecHitParametersGPU.h.

Constructor & Destructor Documentation

◆ EcalRecHitParametersGPU()

EcalRecHitParametersGPU::EcalRecHitParametersGPU ( edm::ParameterSet const &  ps)

Definition at line 9 of file EcalRecHitParametersGPU.cc.

9  {
10  auto const& channelStatusToBeExcluded = StringToEnumValue<EcalChannelStatusCode::Code>(
11  ps.getParameter<std::vector<std::string>>("ChannelStatusToBeExcluded"));
12 
13  channelStatusToBeExcluded_.resize(channelStatusToBeExcluded.size());
14  std::copy(channelStatusToBeExcluded.begin(), channelStatusToBeExcluded.end(), channelStatusToBeExcluded_.begin());
15 
16  // https://github.com/cms-sw/cmssw/blob/266e21cfc9eb409b093e4cf064f4c0a24c6ac293/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc
17 
18  // Translate string representation of flagsMapDBReco into enum values
19  const edm::ParameterSet& p = ps.getParameter<edm::ParameterSet>("flagsMapDBReco");
20  std::vector<std::string> recoflagbitsStrings = p.getParameterNames();
21 
22  for (unsigned int i = 0; i != recoflagbitsStrings.size(); ++i) {
23  EcalRecHit::Flags recoflagbit = (EcalRecHit::Flags)StringToEnumValue<EcalRecHit::Flags>(recoflagbitsStrings[i]);
24  std::vector<std::string> dbstatus_s = p.getParameter<std::vector<std::string>>(recoflagbitsStrings[i]);
25  for (unsigned int j = 0; j != dbstatus_s.size(); ++j) {
27  (EcalChannelStatusCode::Code)StringToEnumValue<EcalChannelStatusCode::Code>(dbstatus_s[j]);
28  expanded_v_DB_reco_flags_.push_back(dbstatus);
29  }
30 
31  expanded_Sizes_v_DB_reco_flags_.push_back(dbstatus_s.size());
32  expanded_flagbit_v_DB_reco_flags_.push_back(recoflagbit);
33  }
34 }

References channelStatusToBeExcluded_, filterCSVwithJSON::copy, expanded_flagbit_v_DB_reco_flags_, expanded_Sizes_v_DB_reco_flags_, expanded_v_DB_reco_flags_, edm::ParameterSet::getParameter(), mps_fire::i, dqmiolumiharvest::j, and AlCaHLTBitMon_ParallelJobs::p.

◆ ~EcalRecHitParametersGPU()

EcalRecHitParametersGPU::~EcalRecHitParametersGPU ( )
default

Member Function Documentation

◆ getProduct()

EcalRecHitParametersGPU::Product const & EcalRecHitParametersGPU::getProduct ( cudaStream_t  cudaStream) const

Definition at line 36 of file EcalRecHitParametersGPU.cc.

36  {
37  auto const& product = product_.dataForCurrentDeviceAsync(
38  cudaStream, [this](EcalRecHitParametersGPU::Product& product, cudaStream_t cudaStream) {
39  // allocate
41  cms::cuda::make_device_unique<int[]>(channelStatusToBeExcluded_.size(), cudaStream);
42  product.expanded_v_DB_reco_flags =
43  cms::cuda::make_device_unique<int[]>(expanded_v_DB_reco_flags_.size(), cudaStream);
45  cms::cuda::make_device_unique<uint32_t[]>(expanded_Sizes_v_DB_reco_flags_.size(), cudaStream);
47  cms::cuda::make_device_unique<uint32_t[]>(expanded_flagbit_v_DB_reco_flags_.size(), cudaStream);
48  // transfer
53  });
54  return product;
55 }

References EcalRecHitParametersGPU::Product::channelStatusToBeExcluded, channelStatusToBeExcluded_, cms::cuda::copyAsync(), EcalRecHitParametersGPU::Product::expanded_flagbit_v_DB_reco_flags, expanded_flagbit_v_DB_reco_flags_, EcalRecHitParametersGPU::Product::expanded_Sizes_v_DB_reco_flags, expanded_Sizes_v_DB_reco_flags_, EcalRecHitParametersGPU::Product::expanded_v_DB_reco_flags, expanded_v_DB_reco_flags_, and product_.

Referenced by EcalRecHitProducerGPU::acquire().

◆ getValues()

std::tuple<intvec, intvec, uint32vec, uint32vec> EcalRecHitParametersGPU::getValues ( ) const
inline

Member Data Documentation

◆ channelStatusToBeExcluded_

std::vector<int, cms::cuda::HostAllocator<int> > EcalRecHitParametersGPU::channelStatusToBeExcluded_
private

Definition at line 41 of file EcalRecHitParametersGPU.h.

Referenced by EcalRecHitParametersGPU(), getProduct(), and getValues().

◆ expanded_flagbit_v_DB_reco_flags_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > EcalRecHitParametersGPU::expanded_flagbit_v_DB_reco_flags_
private

Definition at line 43 of file EcalRecHitParametersGPU.h.

Referenced by EcalRecHitParametersGPU(), getProduct(), and getValues().

◆ expanded_Sizes_v_DB_reco_flags_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > EcalRecHitParametersGPU::expanded_Sizes_v_DB_reco_flags_
private

Definition at line 43 of file EcalRecHitParametersGPU.h.

Referenced by EcalRecHitParametersGPU(), getProduct(), and getValues().

◆ expanded_v_DB_reco_flags_

std::vector<int, cms::cuda::HostAllocator<int> > EcalRecHitParametersGPU::expanded_v_DB_reco_flags_
private

Definition at line 42 of file EcalRecHitParametersGPU.h.

Referenced by EcalRecHitParametersGPU(), getProduct(), and getValues().

◆ product_

cms::cuda::ESProduct<Product> EcalRecHitParametersGPU::product_
private

Definition at line 46 of file EcalRecHitParametersGPU.h.

Referenced by getProduct().

EcalRecHitParametersGPU::channelStatusToBeExcluded_
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
Definition: EcalRecHitParametersGPU.h:41
mps_fire.i
i
Definition: mps_fire.py:428
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:21
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:20
EcalRecHitParametersGPU::expanded_v_DB_reco_flags_
std::vector< int, cms::cuda::HostAllocator< int > > expanded_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:42
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalRecHit::Flags
Flags
Definition: EcalRecHit.h:20
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:43
EcalRecHitParametersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalRecHitParametersGPU.h:46
EcalRecHitParametersGPU::Product
Definition: EcalRecHitParametersGPU.h:17
edm::ParameterSet
Definition: ParameterSet.h:47
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:43
EcalRecHitParametersGPU::Product::channelStatusToBeExcluded
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > channelStatusToBeExcluded
Definition: EcalRecHitParametersGPU.h:18
EcalChannelStatusCode::Code
Code
Definition: EcalChannelStatusCode.h:20
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
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:19
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20