CMS 3D CMS Logo

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

Public Member Functions

 PixelVertexSoAFromCUDA (const edm::ParameterSet &iConfig)
 
 ~PixelVertexSoAFromCUDA () 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

edm::EDGetTokenT< cms::cuda::Product< ZVertexSoADevice > > tokenCUDA_
 
edm::EDPutTokenT< ZVertexSoAHosttokenSOA_
 
ZVertexSoAHost zvertex_h
 

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 21 of file PixelVertexSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ PixelVertexSoAFromCUDA()

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

Definition at line 40 of file PixelVertexSoAFromCUDA.cc.

42  tokenSOA_(produces<ZVertexSoAHost>()) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< cms::cuda::Product< ZVertexSoADevice > > tokenCUDA_
edm::EDPutTokenT< ZVertexSoAHost > tokenSOA_

◆ ~PixelVertexSoAFromCUDA()

PixelVertexSoAFromCUDA::~PixelVertexSoAFromCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

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

Definition at line 51 of file PixelVertexSoAFromCUDA.cc.

References cms::cuda::PortableHostCollection< T >::buffer(), cudaCheck, iEvent, eostools::move(), tokenCUDA_, and zvertex_h.

53  {
54  cms::cuda::Product<ZVertexSoADevice> const& inputDataWrapped = iEvent.get(tokenCUDA_);
55  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
56  auto const& zvertex_d = ctx.get(inputDataWrapped); // Tracks on device
57  zvertex_h = ZVertexSoAHost(ctx.stream()); // Create an instance of Tracks on Host, using the stream
58  cudaCheck(cudaMemcpyAsync(zvertex_h.buffer().get(),
59  zvertex_d.const_buffer().get(),
60  zvertex_d.bufferSize(),
61  cudaMemcpyDeviceToHost,
62  ctx.stream())); // Copy data from Device to Host
63 }
edm::EDGetTokenT< cms::cuda::Product< ZVertexSoADevice > > tokenCUDA_
int iEvent
Definition: GenABIO.cc:224
ZVertexSoAHeterogeneousHost< zVertex::utilities::MAXTRACKS > ZVertexSoAHost
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

Definition at line 44 of file PixelVertexSoAFromCUDA.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_2022v15_cff::InputTag.

44  {
46 
47  desc.add<edm::InputTag>("src", edm::InputTag("pixelVerticesCUDA"));
48  descriptions.add("pixelVerticesSoA", desc);
49 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 65 of file PixelVertexSoAFromCUDA.cc.

References iEvent, eostools::move(), tokenSOA_, and zvertex_h.

65  {
66  // No copies....
68 }
int iEvent
Definition: GenABIO.cc:224
edm::EDPutTokenT< ZVertexSoAHost > tokenSOA_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ tokenCUDA_

edm::EDGetTokenT<cms::cuda::Product<ZVertexSoADevice> > PixelVertexSoAFromCUDA::tokenCUDA_
private

Definition at line 34 of file PixelVertexSoAFromCUDA.cc.

Referenced by acquire().

◆ tokenSOA_

edm::EDPutTokenT<ZVertexSoAHost> PixelVertexSoAFromCUDA::tokenSOA_
private

Definition at line 35 of file PixelVertexSoAFromCUDA.cc.

Referenced by produce().

◆ zvertex_h

ZVertexSoAHost PixelVertexSoAFromCUDA::zvertex_h
private

Definition at line 37 of file PixelVertexSoAFromCUDA.cc.

Referenced by acquire(), and produce().