CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
ecal::raw::ElectronicsMappingGPU Class Reference

#include <ElectronicsMappingGPU.h>

Classes

struct  Product
 

Public Member Functions

 ElectronicsMappingGPU (EcalMappingElectronics const &)
 
Product const & getProduct (cudaStream_t) const
 
 ~ElectronicsMappingGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

std::vector< uint32_t,
cms::cuda::HostAllocator
< uint32_t > > 
eid2did_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 16 of file ElectronicsMappingGPU.h.

Constructor & Destructor Documentation

ecal::raw::ElectronicsMappingGPU::ElectronicsMappingGPU ( EcalMappingElectronics const &  mapping)

Definition at line 13 of file ElectronicsMappingGPU.cc.

References EcalCondObjectContainer< T >::barrelItems(), runTauDisplay::eid, eid2did_, EcalCondObjectContainer< T >::endcapItems(), mps_fire::i, EBDetId::unhashIndex(), and EEDetId::unhashIndex().

13  : eid2did_(0x3FFFFF) {
14  // fill in eb
15  // TODO: EB vector is actually empty
16  auto const& barrelValues = mapping.barrelItems();
17  for (unsigned int i = 0; i < barrelValues.size(); i++) {
18  EcalElectronicsId eid{barrelValues[i].electronicsid};
20  eid2did_[eid.linearIndex()] = did.rawId();
21  }
22 
23  // fill in ee
24  auto const& endcapValues = mapping.endcapItems();
25  for (unsigned int i = 0; i < endcapValues.size(); i++) {
26  EcalElectronicsId eid{endcapValues[i].electronicsid};
28  eid2did_[eid.linearIndex()] = did.rawId();
29  }
30  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > eid2did_
ecal::raw::ElectronicsMappingGPU::~ElectronicsMappingGPU ( )
default

Member Function Documentation

ElectronicsMappingGPU::Product const & ecal::raw::ElectronicsMappingGPU::getProduct ( cudaStream_t  cudaStream) const

Definition at line 32 of file ElectronicsMappingGPU.cc.

References cms::cuda::copyAsync(), ecal::raw::ElectronicsMappingGPU::Product::eid2did, eid2did_, and product_.

32  {
33  auto const& product = product_.dataForCurrentDeviceAsync(
34  cudaStream, [this](ElectronicsMappingGPU::Product& product, cudaStream_t cudaStream) {
35  // allocate
36  product.eid2did = cms::cuda::make_device_unique<uint32_t[]>(eid2did_.size(), cudaStream);
37  // transfer
38  cms::cuda::copyAsync(product.eid2did, eid2did_, cudaStream);
39  });
40 
41  return product;
42  }
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
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > eid2did_
static std::string ecal::raw::ElectronicsMappingGPU::name ( )
inlinestatic

Member Data Documentation

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > ecal::raw::ElectronicsMappingGPU::eid2did_
private

Definition at line 39 of file ElectronicsMappingGPU.h.

Referenced by ElectronicsMappingGPU(), and getProduct().

cms::cuda::ESProduct<Product> ecal::raw::ElectronicsMappingGPU::product_
private

Definition at line 41 of file ElectronicsMappingGPU.h.

Referenced by getProduct().