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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 23 of file PixelTrackSoAFromCUDA.cc.

Constructor & Destructor Documentation

◆ PixelTrackSoAFromCUDA()

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

Definition at line 42 of file PixelTrackSoAFromCUDA.cc.

44  tokenSOA_(produces<PixelTrackHeterogeneous>()) {}

◆ ~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 53 of file PixelTrackSoAFromCUDA.cc.

55  {
56  cms::cuda::Product<PixelTrackHeterogeneous> const& inputDataWrapped = iEvent.get(tokenCUDA_);
57  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
58  auto const& inputData = ctx.get(inputDataWrapped);
59 
60  soa_ = inputData.toHostAsync(ctx.stream());
61 }

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

◆ fillDescriptions()

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

Definition at line 46 of file PixelTrackSoAFromCUDA.cc.

46  {
48 
49  desc.add<edm::InputTag>("src", edm::InputTag("pixelTracksCUDA"));
50  descriptions.add("pixelTracksSoA", desc);
51 }

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

◆ produce()

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

Definition at line 63 of file PixelTrackSoAFromCUDA.cc.

63  {
64 #ifdef PIXEL_DEBUG_PRODUCE
65  auto const& tsoa = *soa_;
66  auto maxTracks = tsoa.stride();
67  std::cout << "size of SoA" << sizeof(tsoa) << " stride " << maxTracks << std::endl;
68 
69  int32_t nt = 0;
70  for (int32_t it = 0; it < maxTracks; ++it) {
71  auto nHits = tsoa.nHits(it);
72  assert(nHits == int(tsoa.hitIndices.size(it)));
73  if (nHits == 0)
74  break; // this is a guard: maybe we need to move to nTracks...
75  nt++;
76  }
77  std::cout << "found " << nt << " tracks in cpu SoA at " << &tsoa << std::endl;
78 #endif
79 
80  // DO NOT make a copy (actually TWO....)
82 
83  assert(!soa_);
84 }

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

Member Data Documentation

◆ soa_

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

Definition at line 39 of file PixelTrackSoAFromCUDA.cc.

Referenced by acquire(), and produce().

◆ tokenCUDA_

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

Definition at line 36 of file PixelTrackSoAFromCUDA.cc.

Referenced by acquire().

◆ tokenSOA_

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

Definition at line 37 of file PixelTrackSoAFromCUDA.cc.

Referenced by produce().

PixelTrackSoAFromCUDA::tokenSOA_
edm::EDPutTokenT< PixelTrackHeterogeneous > tokenSOA_
Definition: PixelTrackSoAFromCUDA.cc:37
nt
int nt
Definition: AMPTWrapper.h:42
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
PixelTrackSoAFromCUDA::soa_
cms::cuda::host::unique_ptr< pixelTrack::TrackSoA > soa_
Definition: PixelTrackSoAFromCUDA.cc:39
HLT_FULL_cff.maxTracks
maxTracks
Definition: HLT_FULL_cff.py:33252
iEvent
int iEvent
Definition: GenABIO.cc:224
PixelTrackSoAFromCUDA::tokenCUDA_
edm::EDGetTokenT< cms::cuda::Product< PixelTrackHeterogeneous > > tokenCUDA_
Definition: PixelTrackSoAFromCUDA.cc:36
cms::cuda::ScopedContextAcquire
Definition: ScopedContext.h:101
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::cuda::Product
Definition: Product.h:34
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PixelTrackHeterogeneous
HeterogeneousSoA< pixelTrack::TrackSoA > PixelTrackHeterogeneous
Definition: PixelTrackHeterogeneous.h:7
edm::InputTag
Definition: InputTag.h:15