CMS 3D CMS Logo

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

Public Types

using HitsOnDevice = TrackingRecHitSoADevice< TrackerTraits >
 
using HitsOnHost = TrackingRecHitSoAHost< TrackerTraits >
 
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

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

HitsOnHost hits_h_
 
const edm::EDPutTokenT< HitsOnHosthitsPutTokenCPU_
 
const edm::EDGetTokenT< cms::cuda::Product< HitsOnDevice > > hitsTokenGPU_
 
const edm::EDPutTokenT< HMSstoragehostPutToken_
 
uint32_t nHits_
 

Detailed Description

template<typename TrackerTraits>
class SiPixelRecHitSoAFromCUDAT< TrackerTraits >

Definition at line 29 of file SiPixelRecHitSoAFromCUDA.cc.

Member Typedef Documentation

◆ HitsOnDevice

template<typename TrackerTraits >
using SiPixelRecHitSoAFromCUDAT< TrackerTraits >::HitsOnDevice = TrackingRecHitSoADevice<TrackerTraits>

Definition at line 37 of file SiPixelRecHitSoAFromCUDA.cc.

◆ HitsOnHost

template<typename TrackerTraits >
using SiPixelRecHitSoAFromCUDAT< TrackerTraits >::HitsOnHost = TrackingRecHitSoAHost<TrackerTraits>

Definition at line 36 of file SiPixelRecHitSoAFromCUDA.cc.

◆ HMSstorage

template<typename TrackerTraits >
using SiPixelRecHitSoAFromCUDAT< TrackerTraits >::HMSstorage = HostProduct<uint32_t[]>

Definition at line 35 of file SiPixelRecHitSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelRecHitSoAFromCUDAT()

template<typename TrackerTraits >
SiPixelRecHitSoAFromCUDAT< TrackerTraits >::SiPixelRecHitSoAFromCUDAT ( const edm::ParameterSet iConfig)
explicit

Definition at line 54 of file SiPixelRecHitSoAFromCUDA.cc.

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

◆ ~SiPixelRecHitSoAFromCUDAT()

template<typename TrackerTraits >
SiPixelRecHitSoAFromCUDAT< TrackerTraits >::~SiPixelRecHitSoAFromCUDAT ( )
overridedefault

Member Function Documentation

◆ acquire()

template<typename TrackerTraits >
void SiPixelRecHitSoAFromCUDAT< TrackerTraits >::acquire ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
overrideprivate

Definition at line 68 of file SiPixelRecHitSoAFromCUDA.cc.

References cudaCheck, iEvent, LogDebug, and eostools::move().

70  {
71  cms::cuda::Product<HitsOnDevice> const& inputDataWrapped = iEvent.get(hitsTokenGPU_);
72  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
73  auto const& inputData = ctx.get(inputDataWrapped);
74 
75  nHits_ = inputData.nHits();
76  hits_h_ = HitsOnHost(nHits_, ctx.stream());
77  cudaCheck(cudaMemcpyAsync(hits_h_.buffer().get(),
78  inputData.const_buffer().get(),
79  inputData.bufferSize(),
80  cudaMemcpyDeviceToHost,
81  ctx.stream())); // Copy data from Device to Host
82  LogDebug("SiPixelRecHitSoAFromCUDA") << "copying to cpu SoA" << inputData.nHits() << " Hits";
83 }
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< cms::cuda::Product< HitsOnDevice > > hitsTokenGPU_
TrackingRecHitSoAHost< TrackerTraits > HitsOnHost
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ fillDescriptions()

template<typename TrackerTraits >
void SiPixelRecHitSoAFromCUDAT< TrackerTraits >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

◆ produce()

template<typename TrackerTraits >
void SiPixelRecHitSoAFromCUDAT< TrackerTraits >::produce ( edm::Event iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 86 of file SiPixelRecHitSoAFromCUDA.cc.

References filterCSVwithJSON::copy, iEvent, eostools::move(), and phase1PixelTopology::numberOfModules.

86  {
87  auto hmsp = std::make_unique<uint32_t[]>(TrackerTraits::numberOfModules + 1);
88 
89  if (nHits_ > 0)
90  std::copy(hits_h_.view().hitsModuleStart().begin(), hits_h_.view().hitsModuleStart().end(), hmsp.get());
91 
92  iEvent.emplace(hostPutToken_, std::move(hmsp));
94 }
const edm::EDPutTokenT< HitsOnHost > hitsPutTokenCPU_
constexpr uint16_t numberOfModules
int iEvent
Definition: GenABIO.cc:224
const edm::EDPutTokenT< HMSstorage > hostPutToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ hits_h_

template<typename TrackerTraits >
HitsOnHost SiPixelRecHitSoAFromCUDAT< TrackerTraits >::hits_h_
private

Definition at line 50 of file SiPixelRecHitSoAFromCUDA.cc.

◆ hitsPutTokenCPU_

template<typename TrackerTraits >
const edm::EDPutTokenT<HitsOnHost> SiPixelRecHitSoAFromCUDAT< TrackerTraits >::hitsPutTokenCPU_
private

Definition at line 46 of file SiPixelRecHitSoAFromCUDA.cc.

◆ hitsTokenGPU_

template<typename TrackerTraits >
const edm::EDGetTokenT<cms::cuda::Product<HitsOnDevice> > SiPixelRecHitSoAFromCUDAT< TrackerTraits >::hitsTokenGPU_
private

Definition at line 45 of file SiPixelRecHitSoAFromCUDA.cc.

◆ hostPutToken_

template<typename TrackerTraits >
const edm::EDPutTokenT<HMSstorage> SiPixelRecHitSoAFromCUDAT< TrackerTraits >::hostPutToken_
private

Definition at line 47 of file SiPixelRecHitSoAFromCUDA.cc.

◆ nHits_

template<typename TrackerTraits >
uint32_t SiPixelRecHitSoAFromCUDAT< TrackerTraits >::nHits_
private

Definition at line 49 of file SiPixelRecHitSoAFromCUDA.cc.