CMS 3D CMS Logo

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

Public Member Functions

 SiPixelDigisSoAFromCUDA (const edm::ParameterSet &iConfig)
 
 ~SiPixelDigisSoAFromCUDA () 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 (const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

edm::EDGetTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiGetToken_
 
edm::EDPutTokenT< legacy::SiPixelDigisSoAdigiPutToken_
 
cms::cuda::PortableHostCollection< SiPixelDigisSoAdigis_h_
 
int nDigis_
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 15 of file SiPixelDigisSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelDigisSoAFromCUDA()

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

Definition at line 36 of file SiPixelDigisSoAFromCUDA.cc.

38  digiPutToken_(produces<legacy::SiPixelDigisSoA>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDPutTokenT< legacy::SiPixelDigisSoA > digiPutToken_
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiGetToken_

◆ ~SiPixelDigisSoAFromCUDA()

SiPixelDigisSoAFromCUDA::~SiPixelDigisSoAFromCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

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

Definition at line 46 of file SiPixelDigisSoAFromCUDA.cc.

References cudaCheck, digiGetToken_, digis_h_, iEvent, eostools::move(), and nDigis_.

48  {
49  // Do the transfer in a CUDA stream parallel to the computation CUDA stream
50  cms::cuda::ScopedContextAcquire ctx{iEvent.streamID(), std::move(waitingTaskHolder)};
51 
52  const auto& digis_d = ctx.get(iEvent, digiGetToken_);
53 
54  nDigis_ = digis_d.nDigis();
55  digis_h_ = cms::cuda::PortableHostCollection<SiPixelDigisSoA>(digis_d.view().metadata().size(), ctx.stream());
56  cudaCheck(cudaMemcpyAsync(digis_h_.buffer().get(),
57  digis_d.const_buffer().get(),
58  digis_d.bufferSize(),
59  cudaMemcpyDeviceToHost,
60  ctx.stream()));
61 }
int iEvent
Definition: GenABIO.cc:224
cms::cuda::PortableHostCollection< SiPixelDigisSoA > digis_h_
edm::EDGetTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiGetToken_
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

◆ produce()

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

Definition at line 63 of file SiPixelDigisSoAFromCUDA.cc.

References digiPutToken_, digis_h_, iEvent, and nDigis_.

63  {
64  iEvent.emplace(digiPutToken_,
65  nDigis_,
66  digis_h_.view().pdigi(),
67  digis_h_.view().rawIdArr(),
68  digis_h_.view().adc(),
69  digis_h_.view().clus());
70 }
edm::EDPutTokenT< legacy::SiPixelDigisSoA > digiPutToken_
int iEvent
Definition: GenABIO.cc:224
cms::cuda::PortableHostCollection< SiPixelDigisSoA > digis_h_

Member Data Documentation

◆ digiGetToken_

edm::EDGetTokenT<cms::cuda::Product<SiPixelDigisCUDA> > SiPixelDigisSoAFromCUDA::digiGetToken_
private

Definition at line 28 of file SiPixelDigisSoAFromCUDA.cc.

Referenced by acquire().

◆ digiPutToken_

edm::EDPutTokenT<legacy::SiPixelDigisSoA> SiPixelDigisSoAFromCUDA::digiPutToken_
private

Definition at line 29 of file SiPixelDigisSoAFromCUDA.cc.

Referenced by produce().

◆ digis_h_

cms::cuda::PortableHostCollection<SiPixelDigisSoA> SiPixelDigisSoAFromCUDA::digis_h_
private

Definition at line 31 of file SiPixelDigisSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ nDigis_

int SiPixelDigisSoAFromCUDA::nDigis_
private

Definition at line 33 of file SiPixelDigisSoAFromCUDA.cc.

Referenced by acquire(), and produce().