CMS 3D CMS Logo

PixelVertexSoAFromCUDA.cc
Go to the documentation of this file.
1 #include <cuda_runtime.h>
2 
19 
20 class PixelVertexSoAFromCUDA : public edm::stream::EDProducer<edm::ExternalWork> {
21 public:
22  explicit PixelVertexSoAFromCUDA(const edm::ParameterSet& iConfig);
23  ~PixelVertexSoAFromCUDA() override = default;
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
28  void acquire(edm::Event const& iEvent,
29  edm::EventSetup const& iSetup,
30  edm::WaitingTaskWithArenaHolder waitingTaskHolder) override;
31  void produce(edm::Event& iEvent, edm::EventSetup const& iSetup) override;
32 
35 
37 };
38 
40  : tokenCUDA_(consumes<cms::cuda::Product<ZVertexHeterogeneous>>(iConfig.getParameter<edm::InputTag>("src"))),
41  tokenSOA_(produces<ZVertexHeterogeneous>()) {}
42 
45 
46  desc.add<edm::InputTag>("src", edm::InputTag("pixelVerticesCUDA"));
47  descriptions.add("pixelVerticesSoA", desc);
48 }
49 
51  edm::EventSetup const& iSetup,
52  edm::WaitingTaskWithArenaHolder waitingTaskHolder) {
53  auto const& inputDataWrapped = iEvent.get(tokenCUDA_);
54  cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)};
55  auto const& inputData = ctx.get(inputDataWrapped);
56 
57  m_soa = inputData.toHostAsync(ctx.stream());
58 }
59 
61  // No copies....
63 }
64 
ConfigurationDescriptions.h
PixelVertexSoAFromCUDA::m_soa
cms::cuda::host::unique_ptr< ZVertexSoA > m_soa
Definition: PixelVertexSoAFromCUDA.cc:36
Handle.h
ESHandle.h
PixelVertexSoAFromCUDA::produce
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) override
Definition: PixelVertexSoAFromCUDA.cc:60
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT
Definition: EDPutToken.h:33
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EDProducer.h
PixelVertexSoAFromCUDA::~PixelVertexSoAFromCUDA
~PixelVertexSoAFromCUDA() override=default
HostProduct.h
HeterogeneousSoA
Definition: HeterogeneousSoA.h:13
edm::WaitingTaskWithArenaHolder
Definition: WaitingTaskWithArenaHolder.h:34
MakerMacros.h
PixelVertexSoAFromCUDA::acquire
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
Definition: PixelVertexSoAFromCUDA.cc:50
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
ParameterSetDescription.h
EDGetToken.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
ZVertexHeterogeneous
HeterogeneousSoA< ZVertexSoA > ZVertexHeterogeneous
Definition: ZVertexHeterogeneous.h:8
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ModuleDef.h
iEvent
int iEvent
Definition: GenABIO.cc:224
PixelVertexSoAFromCUDA::PixelVertexSoAFromCUDA
PixelVertexSoAFromCUDA(const edm::ParameterSet &iConfig)
Definition: PixelVertexSoAFromCUDA.cc:39
edm::stream::EDProducer
Definition: EDProducer.h:38
ZVertexHeterogeneous.h
PixelVertexSoAFromCUDA::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelVertexSoAFromCUDA.cc:43
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
PixelVertexSoAFromCUDA
Definition: PixelVertexSoAFromCUDA.cc:20
PixelVertexSoAFromCUDA::tokenCUDA_
edm::EDGetTokenT< cms::cuda::Product< ZVertexHeterogeneous > > tokenCUDA_
Definition: PixelVertexSoAFromCUDA.cc:33
cms::cuda::ScopedContextAcquire
Definition: ScopedContext.h:101
Product.h
PixelVertexSoAFromCUDA::tokenSOA_
edm::EDPutTokenT< ZVertexHeterogeneous > tokenSOA_
Definition: PixelVertexSoAFromCUDA.cc:34
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::cuda::host::unique_ptr
std::unique_ptr< T, impl::HostDeleter > unique_ptr
Definition: host_unique_ptr.h:21
ScopedContext.h
ecalDigis_cff.cuda
cuda
Definition: ecalDigis_cff.py:35
EventSetup.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21