CMS 3D CMS Logo

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

Public Member Functions

 PixelTrackSoAFromCUDA (const edm::ParameterSet &iConfig)
 
 ~PixelTrackSoAFromCUDA () 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< pixelTrack::TrackSoAsoa_
 
edm::EDGetTokenT< cms::cuda::Product< PixelTrackHeterogeneous > > tokenCUDA_
 
edm::EDPutTokenT< PixelTrackHeterogeneoustokenSOA_
 

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 22 of file PixelTrackSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ PixelTrackSoAFromCUDA()

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

Definition at line 41 of file PixelTrackSoAFromCUDA.cc.

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

◆ ~PixelTrackSoAFromCUDA()

PixelTrackSoAFromCUDA::~PixelTrackSoAFromCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

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

Definition at line 52 of file PixelTrackSoAFromCUDA.cc.

References iEvent, eostools::move(), soa_, and tokenCUDA_.

54  {
55  cms::cuda::Product<PixelTrackHeterogeneous> const& inputDataWrapped = iEvent.get(tokenCUDA_);
56  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
57  auto const& inputData = ctx.get(inputDataWrapped);
58 
59  soa_ = inputData.toHostAsync(ctx.stream());
60 }
cms::cuda::host::unique_ptr< pixelTrack::TrackSoA > soa_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< cms::cuda::Product< PixelTrackHeterogeneous > > tokenCUDA_
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

Definition at line 45 of file PixelTrackSoAFromCUDA.cc.

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

45  {
47 
48  desc.add<edm::InputTag>("src", edm::InputTag("pixelTracksCUDA"));
49  descriptions.add("pixelTracksSoA", desc);
50 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 62 of file PixelTrackSoAFromCUDA.cc.

References cms::cuda::assert(), gather_cfg::cout, iEvent, HLT_2022v14_cff::maxTracks, eostools::move(), nHits, nt, BeamSpotPI::nTracks, soa_, and tokenSOA_.

62  {
63  // check that the fixed-size SoA does not overflow
64  auto const& tsoa = *soa_;
65  auto maxTracks = tsoa.stride();
66  auto nTracks = tsoa.nTracks();
68  if (nTracks == maxTracks - 1) {
69  edm::LogWarning("PixelTracks") << "Unsorted reconstructed pixel tracks truncated to " << maxTracks - 1
70  << " candidates";
71  }
72 
73 #ifdef PIXEL_DEBUG_PRODUCE
74  std::cout << "size of SoA " << sizeof(tsoa) << " stride " << maxTracks << std::endl;
75  std::cout << "found " << nTracks << " tracks in cpu SoA at " << &tsoa << std::endl;
76 
77  int32_t nt = 0;
78  for (int32_t it = 0; it < maxTracks; ++it) {
79  auto nHits = tsoa.nHits(it);
80  assert(nHits == int(tsoa.hitIndices.size(it)));
81  if (nHits == 0)
82  break; // this is a guard: maybe we need to move to nTracks...
83  nt++;
84  }
85  assert(nTracks == nt);
86 #endif
87 
88  // DO NOT make a copy (actually TWO....)
89  iEvent.emplace(tokenSOA_, std::move(soa_));
90 
91  assert(!soa_);
92 }
edm::EDPutTokenT< PixelTrackHeterogeneous > tokenSOA_
cms::cuda::host::unique_ptr< pixelTrack::TrackSoA > soa_
assert(be >=bs)
int iEvent
Definition: GenABIO.cc:224
int nt
Definition: AMPTWrapper.h:42
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
Log< level::Warning, false > LogWarning
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ soa_

cms::cuda::host::unique_ptr<pixelTrack::TrackSoA> PixelTrackSoAFromCUDA::soa_
private

Definition at line 38 of file PixelTrackSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ tokenCUDA_

edm::EDGetTokenT<cms::cuda::Product<PixelTrackHeterogeneous> > PixelTrackSoAFromCUDA::tokenCUDA_
private

Definition at line 35 of file PixelTrackSoAFromCUDA.cc.

Referenced by acquire().

◆ tokenSOA_

edm::EDPutTokenT<PixelTrackHeterogeneous> PixelTrackSoAFromCUDA::tokenSOA_
private

Definition at line 36 of file PixelTrackSoAFromCUDA.cc.

Referenced by produce().