CMS 3D CMS Logo

PixelTrackDumpCUDA.cc
Go to the documentation of this file.
1 #include <cuda_runtime.h>
2 
23 
25 public:
26  explicit PixelTrackDumpCUDA(const edm::ParameterSet& iConfig);
27  ~PixelTrackDumpCUDA() override = default;
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
30 
31 private:
32  void analyze(edm::StreamID streamID, edm::Event const& iEvent, const edm::EventSetup& iSetup) const override;
33  const bool m_onGPU;
38 };
39 
41  : m_onGPU(iConfig.getParameter<bool>("onGPU")) {
42  if (m_onGPU) {
44  consumes<cms::cuda::Product<PixelTrackHeterogeneous>>(iConfig.getParameter<edm::InputTag>("pixelTrackSrc"));
46  consumes<cms::cuda::Product<ZVertexHeterogeneous>>(iConfig.getParameter<edm::InputTag>("pixelVertexSrc"));
47  } else {
48  tokenSoATrack_ = consumes<PixelTrackHeterogeneous>(iConfig.getParameter<edm::InputTag>("pixelTrackSrc"));
49  tokenSoAVertex_ = consumes<ZVertexHeterogeneous>(iConfig.getParameter<edm::InputTag>("pixelVertexSrc"));
50  }
51 }
52 
55 
56  desc.add<bool>("onGPU", true);
57  desc.add<edm::InputTag>("pixelTrackSrc", edm::InputTag("pixelTracksCUDA"));
58  desc.add<edm::InputTag>("pixelVertexSrc", edm::InputTag("pixelVerticesCUDA"));
59  descriptions.add("pixelTrackDumpCUDA", desc);
60 }
61 
63  edm::Event const& iEvent,
64  const edm::EventSetup& iSetup) const {
65  if (m_onGPU) {
66  auto const& hTracks = iEvent.get(tokenGPUTrack_);
68 
69  auto const& tracks = ctx.get(hTracks);
70  auto const* tsoa = tracks.get();
71  assert(tsoa);
72 
73  auto const& vertices = ctx.get(iEvent.get(tokenGPUVertex_));
74  auto const* vsoa = vertices.get();
75  assert(vsoa);
76 
77  } else {
78  auto const* tsoa = iEvent.get(tokenSoATrack_).get();
79  assert(tsoa);
80 
81  auto const* vsoa = iEvent.get(tokenSoAVertex_).get();
82  assert(vsoa);
83  }
84 }
85 
ConfigurationDescriptions.h
RunningAverage.h
edm::StreamID
Definition: StreamID.h:30
PixelTrackDumpCUDA::tokenSoAVertex_
edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertex_
Definition: PixelTrackDumpCUDA.cc:37
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:366
PixelTrackDumpCUDA::~PixelTrackDumpCUDA
~PixelTrackDumpCUDA() override=default
ESHandle.h
cms::cuda::ScopedContextProduce
Definition: ScopedContext.h:149
edm::EDGetTokenT
Definition: EDGetToken.h:33
TrackingRecHit2DHeterogeneous.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
PixelTrackDumpCUDA::PixelTrackDumpCUDA
PixelTrackDumpCUDA(const edm::ParameterSet &iConfig)
Definition: PixelTrackDumpCUDA.cc:40
PixelTrackDumpCUDA::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelTrackDumpCUDA.cc:53
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PixelTrackDumpCUDA::tokenSoATrack_
edm::EDGetTokenT< PixelTrackHeterogeneous > tokenSoATrack_
Definition: PixelTrackDumpCUDA.cc:36
PixelRecoUtilities.h
ParameterSetDescription.h
EDGetToken.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
ModuleDef.h
PixelTrackDumpCUDA::m_onGPU
const bool m_onGPU
Definition: PixelTrackDumpCUDA.cc:33
iEvent
int iEvent
Definition: GenABIO.cc:224
PixelTrackDumpCUDA::tokenGPUVertex_
edm::EDGetTokenT< cms::cuda::Product< ZVertexHeterogeneous > > tokenGPUVertex_
Definition: PixelTrackDumpCUDA.cc:35
ZVertexHeterogeneous.h
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
Product.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ScopedContext.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PixelTrackHeterogeneous.h
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
PixelTrackDumpCUDA::analyze
void analyze(edm::StreamID streamID, edm::Event const &iEvent, const edm::EventSetup &iSetup) const override
Definition: PixelTrackDumpCUDA.cc:62
PixelTrackDumpCUDA
Definition: PixelTrackDumpCUDA.cc:24
EDAnalyzer.h
edm::InputTag
Definition: InputTag.h:15
edm::global::EDAnalyzer
Definition: EDAnalyzer.h:32
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
PixelTrackDumpCUDA::tokenGPUTrack_
edm::EDGetTokenT< cms::cuda::Product< PixelTrackHeterogeneous > > tokenGPUTrack_
Definition: PixelTrackDumpCUDA.cc:34