CMS 3D CMS Logo

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

#include <EcalRecHitParametersGPU.h>

Classes

struct  DBStatus
 
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 (std::vector< int > const &channelStatusToBeExcluded, std::vector< DBStatus > const &flagsMapDBReco)
 channelStatusToBeExcluded must contain EcalChannelStatusCode::Code More...
 
Product const & getProduct (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 14 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 38 of file EcalRecHitParametersGPU.h.

◆ uint32vec

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

Definition at line 39 of file EcalRecHitParametersGPU.h.

Constructor & Destructor Documentation

◆ EcalRecHitParametersGPU()

EcalRecHitParametersGPU::EcalRecHitParametersGPU ( std::vector< int > const &  channelStatusToBeExcluded,
std::vector< DBStatus > const &  flagsMapDBReco 
)

channelStatusToBeExcluded must contain EcalChannelStatusCode::Code

Definition at line 8 of file EcalRecHitParametersGPU.cc.

References channelStatusToBeExcluded_, filterCSVwithJSON::copy, expanded_flagbit_v_DB_reco_flags_, expanded_Sizes_v_DB_reco_flags_, expanded_v_DB_reco_flags_, HLT_2024v11_cff::flagsMapDBReco, and findQualityFiles::v.

9  {
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 }
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
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_

◆ ~EcalRecHitParametersGPU()

EcalRecHitParametersGPU::~EcalRecHitParametersGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 25 of file EcalRecHitParametersGPU.cc.

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().

25  {
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 }
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > expanded_v_DB_reco_flags
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
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
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_flagbit_v_DB_reco_flags

◆ getValues()

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

Definition at line 40 of file EcalRecHitParametersGPU.h.

References channelStatusToBeExcluded_, expanded_flagbit_v_DB_reco_flags_, expanded_Sizes_v_DB_reco_flags_, and expanded_v_DB_reco_flags_.

Referenced by EcalRecHitProducerGPU::acquire().

40  {
45  }
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
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_

Member Data Documentation

◆ channelStatusToBeExcluded_

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

Definition at line 48 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 50 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 50 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 49 of file EcalRecHitParametersGPU.h.

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

◆ product_

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

Definition at line 53 of file EcalRecHitParametersGPU.h.

Referenced by getProduct().