CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelRecHitSoAFromCUDA Class Reference
Inheritance diagram for SiPixelRecHitSoAFromCUDA:
edm::stream::EDProducer< edm::ExternalWork >

Public Types

using HMSstorage = HostProduct< uint32_t[]>
 
- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 SiPixelRecHitSoAFromCUDA (const edm::ParameterSet &iConfig)
 
 ~SiPixelRecHitSoAFromCUDA () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
 
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) override
 

Private Attributes

cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_
 
const edm::EDPutTokenT< TrackingRecHit2DCPUhitsPutTokenCPU_
 
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > hitsTokenGPU_
 
const edm::EDPutTokenT< HMSstoragehostPutToken_
 
uint32_t nHits_
 
uint32_t nMaxModules_
 
cms::cuda::host::unique_ptr< uint16_t[]> store16_
 
cms::cuda::host::unique_ptr< float[]> store32_
 

Detailed Description

Definition at line 27 of file SiPixelRecHitSoAFromCUDA.cc.

Member Typedef Documentation

◆ HMSstorage

Definition at line 33 of file SiPixelRecHitSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelRecHitSoAFromCUDA()

SiPixelRecHitSoAFromCUDA::SiPixelRecHitSoAFromCUDA ( const edm::ParameterSet iConfig)
explicit

Definition at line 53 of file SiPixelRecHitSoAFromCUDA.cc.

54  : hitsTokenGPU_(
55  consumes<cms::cuda::Product<TrackingRecHit2DGPU>>(iConfig.getParameter<edm::InputTag>("pixelRecHitSrc"))),
56  hitsPutTokenCPU_(produces<TrackingRecHit2DCPU>()),
57  hostPutToken_(produces<HMSstorage>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDPutTokenT< TrackingRecHit2DCPU > hitsPutTokenCPU_
const edm::EDPutTokenT< HMSstorage > hostPutToken_
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > hitsTokenGPU_

◆ ~SiPixelRecHitSoAFromCUDA()

SiPixelRecHitSoAFromCUDA::~SiPixelRecHitSoAFromCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

void SiPixelRecHitSoAFromCUDA::acquire ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
overrideprivate

Definition at line 65 of file SiPixelRecHitSoAFromCUDA.cc.

References hitsModuleStart_, hitsTokenGPU_, iEvent, LogDebug, eostools::move(), nHits_, nMaxModules_, store16_, and store32_.

67  {
68  cms::cuda::Product<TrackingRecHit2DGPU> const& inputDataWrapped = iEvent.get(hitsTokenGPU_);
69  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
70  auto const& inputData = ctx.get(inputDataWrapped);
71 
72  nHits_ = inputData.nHits();
73  LogDebug("SiPixelRecHitSoAFromCUDA") << "copying to cpu SoA" << inputData.nHits() << " Hits";
74 
75  if (0 == nHits_)
76  return;
77  nMaxModules_ = inputData.nMaxModules();
78  store32_ = inputData.store32ToHostAsync(ctx.stream());
79  store16_ = inputData.store16ToHostAsync(ctx.stream());
80  hitsModuleStart_ = inputData.hitsModuleStartToHostAsync(ctx.stream());
81 }
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > hitsTokenGPU_
cms::cuda::host::unique_ptr< uint16_t[]> store16_
cms::cuda::host::unique_ptr< float[]> store32_
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ fillDescriptions()

void SiPixelRecHitSoAFromCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

◆ produce()

void SiPixelRecHitSoAFromCUDA::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 83 of file SiPixelRecHitSoAFromCUDA.cc.

References filterCSVwithJSON::copy, hitsModuleStart_, hitsPutTokenCPU_, hostPutToken_, iEvent, eostools::move(), nHits_, nMaxModules_, store16_, and store32_.

83  {
84  auto hmsp = std::make_unique<uint32_t[]>(nMaxModules_ + 1);
85 
86  if (nHits_ > 0)
87  std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + nMaxModules_ + 1, hmsp.get());
88 
89  iEvent.emplace(hostPutToken_, std::move(hmsp));
90  iEvent.emplace(hitsPutTokenCPU_, store32_.get(), store16_.get(), hitsModuleStart_.get(), nHits_);
91 }
const edm::EDPutTokenT< TrackingRecHit2DCPU > hitsPutTokenCPU_
int iEvent
Definition: GenABIO.cc:224
const edm::EDPutTokenT< HMSstorage > hostPutToken_
cms::cuda::host::unique_ptr< uint16_t[]> store16_
cms::cuda::host::unique_ptr< float[]> store32_
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ hitsModuleStart_

cms::cuda::host::unique_ptr<uint32_t[]> SiPixelRecHitSoAFromCUDA::hitsModuleStart_
private

Definition at line 50 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ hitsPutTokenCPU_

const edm::EDPutTokenT<TrackingRecHit2DCPU> SiPixelRecHitSoAFromCUDA::hitsPutTokenCPU_
private

Definition at line 42 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by produce().

◆ hitsTokenGPU_

const edm::EDGetTokenT<cms::cuda::Product<TrackingRecHit2DGPU> > SiPixelRecHitSoAFromCUDA::hitsTokenGPU_
private

Definition at line 41 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire().

◆ hostPutToken_

const edm::EDPutTokenT<HMSstorage> SiPixelRecHitSoAFromCUDA::hostPutToken_
private

Definition at line 43 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by produce().

◆ nHits_

uint32_t SiPixelRecHitSoAFromCUDA::nHits_
private

Definition at line 45 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ nMaxModules_

uint32_t SiPixelRecHitSoAFromCUDA::nMaxModules_
private

Definition at line 46 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ store16_

cms::cuda::host::unique_ptr<uint16_t[]> SiPixelRecHitSoAFromCUDA::store16_
private

Definition at line 49 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ store32_

cms::cuda::host::unique_ptr<float[]> SiPixelRecHitSoAFromCUDA::store32_
private

Definition at line 48 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().