CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< TrackingRecHit2DCPU
hitsPutTokenCPU_
 
const edm::EDGetTokenT
< cms::cuda::Product
< TrackingRecHit2DGPU > > 
hitsTokenGPU_
 
const edm::EDPutTokenT
< HMSstorage
hostPutToken_
 
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

Definition at line 33 of file SiPixelRecHitSoAFromCUDA.cc.

Constructor & Destructor Documentation

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>()) {}
const edm::EDPutTokenT< TrackingRecHit2DCPU > hitsPutTokenCPU_
const edm::EDPutTokenT< HMSstorage > hostPutToken_
const edm::EDGetTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > hitsTokenGPU_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelRecHitSoAFromCUDA::~SiPixelRecHitSoAFromCUDA ( )
overridedefault

Member Function Documentation

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

Definition at line 65 of file SiPixelRecHitSoAFromCUDA.cc.

References edm::Event::get(), hitsModuleStart_, hitsTokenGPU_, 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
def move
Definition: eostools.py:511
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_
#define LogDebug(id)
void SiPixelRecHitSoAFromCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 59 of file SiPixelRecHitSoAFromCUDA.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

59  {
61  desc.add<edm::InputTag>("pixelRecHitSrc", edm::InputTag("siPixelRecHitsPreSplittingCUDA"));
62  descriptions.addWithDefaultLabel(desc);
63 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void SiPixelRecHitSoAFromCUDA::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 83 of file SiPixelRecHitSoAFromCUDA.cc.

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

83  {
84  auto hmsp = std::make_unique<uint32_t[]>(nMaxModules_ + 1);
85  std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + nMaxModules_ + 1, hmsp.get());
86 
87  iEvent.emplace(hostPutToken_, std::move(hmsp));
88  iEvent.emplace(hitsPutTokenCPU_, store32_.get(), store16_.get(), hitsModuleStart_.get(), nHits_);
89 }
const edm::EDPutTokenT< TrackingRecHit2DCPU > hitsPutTokenCPU_
const edm::EDPutTokenT< HMSstorage > hostPutToken_
def move
Definition: eostools.py:511
cms::cuda::host::unique_ptr< uint16_t[]> store16_
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
cms::cuda::host::unique_ptr< float[]> store32_
cms::cuda::host::unique_ptr< uint32_t[]> hitsModuleStart_

Member Data Documentation

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

Definition at line 50 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

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

Definition at line 42 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by produce().

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

Definition at line 41 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire().

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

Definition at line 43 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by produce().

uint32_t SiPixelRecHitSoAFromCUDA::nHits_
private

Definition at line 45 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

uint32_t SiPixelRecHitSoAFromCUDA::nMaxModules_
private

Definition at line 46 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

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

Definition at line 49 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().

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

Definition at line 48 of file SiPixelRecHitSoAFromCUDA.cc.

Referenced by acquire(), and produce().