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 
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
cms::cuda::host::unique_ptr< ZVertexSoA > m_soa
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< cms::cuda::Product< ZVertexHeterogeneous > > tokenCUDA_
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
~PixelVertexSoAFromCUDA() override=default
PixelVertexSoAFromCUDA(const edm::ParameterSet &iConfig)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Namespace of DDCMS conversion namespace.
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) override
edm::EDPutTokenT< ZVertexHeterogeneous > tokenSOA_
HLT enums.
std::unique_ptr< T, impl::HostDeleter > unique_ptr
HeterogeneousSoA< ZVertexSoA > ZVertexHeterogeneous
def move(src, dest)
Definition: eostools.py:511