CMS 3D CMS Logo

SynchronizingEDProducer.h
Go to the documentation of this file.
1 #ifndef HeterogeneousCore_AlpakaCore_interface_alpaka_stream_SynchronizingEDProducer_h
2 #define HeterogeneousCore_AlpakaCore_interface_alpaka_stream_SynchronizingEDProducer_h
3 
12 
14  namespace stream {
15  template <typename... Args>
16  class SynchronizingEDProducer : public ProducerBase<edm::stream::EDProducer, edm::ExternalWork, Args...> {
17  static_assert(
19  "ExternalWork ability is redundant with ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer."
20  "Please remove it.");
21 
22  public:
23  void acquire(edm::Event const& iEvent,
24  edm::EventSetup const& iSetup,
25  edm::WaitingTaskWithArenaHolder holder) final {
26  detail::EDMetadataAcquireSentry sentry(iEvent.streamID(), std::move(holder));
27  device::Event const ev(iEvent, sentry.metadata());
28  device::EventSetup const es(iSetup, ev.device());
29  acquire(ev, es);
30  metadata_ = sentry.finish();
31  }
32 
33  void produce(edm::Event& iEvent, edm::EventSetup const& iSetup) final {
35  device::Event ev(iEvent, sentry.metadata());
36  device::EventSetup const es(iSetup, ev.device());
37  produce(ev, es);
38  this->putBackend(iEvent);
39  sentry.finish(ev.wasQueueUsed());
40  }
41 
42  virtual void acquire(device::Event const& iEvent, device::EventSetup const& iSetup) = 0;
43 
44  virtual void produce(device::Event& iEvent, device::EventSetup const& iSetup) = 0;
45 
46  private:
47  std::shared_ptr<EDMetadata> metadata_;
48  };
49  } // namespace stream
50 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
51 
52 #endif
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void acquire(edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder holder) final
int iEvent
Definition: GenABIO.cc:224
void produce(edm::Event &iEvent, edm::EventSetup const &iSetup) final
def move(src, dest)
Definition: eostools.py:511