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< SiPixelDigisSoAdigiPutToken_
 
cms::cuda::PortableHostCollection< SiPixelDigisSoALayout<> > digis_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<SiPixelDigisSoA>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDPutTokenT< 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 cms::cuda::PortableHostCollection< T >::buffer(), 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  nDigis_ = digis_d.nDigis();
56  digis_h_ = cms::cuda::PortableHostCollection<SiPixelDigisSoALayout<>>(digis_d.view().metadata().size(), ctx.stream());
57  cudaCheck(cudaMemcpyAsync(digis_h_.buffer().get(),
58  digis_d.const_buffer().get(),
59  digis_d.bufferSize(),
60  cudaMemcpyDeviceToHost,
61  ctx.stream()));
62 }
int iEvent
Definition: GenABIO.cc:224
cms::cuda::PortableHostCollection< SiPixelDigisSoALayout<> > 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 64 of file SiPixelDigisSoAFromCUDA.cc.

References digiPutToken_, digis_h_, iEvent, nDigis_, and cms::cuda::PortableHostCollection< T >::view().

64  {
65  iEvent.emplace(digiPutToken_,
66  nDigis_,
67  digis_h_.view().pdigi(),
68  digis_h_.view().rawIdArr(),
69  digis_h_.view().adc(),
70  digis_h_.view().clus());
71 }
edm::EDPutTokenT< SiPixelDigisSoA > digiPutToken_
int iEvent
Definition: GenABIO.cc:224
cms::cuda::PortableHostCollection< SiPixelDigisSoALayout<> > 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<SiPixelDigisSoA> SiPixelDigisSoAFromCUDA::digiPutToken_
private

Definition at line 29 of file SiPixelDigisSoAFromCUDA.cc.

Referenced by produce().

◆ digis_h_

cms::cuda::PortableHostCollection<SiPixelDigisSoALayout<> > 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().