CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TestAlpakaProducer.cc
Go to the documentation of this file.
15 
16 #include "TestAlgo.h"
17 
19 
21  public:
23  : deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}
24 
25  void produce(edm::Event& event, edm::EventSetup const&) override {
26  // create a context based on the EDM stream number
28 
29  // run the algorithm, potentially asynchronously
30  portabletest::TestDeviceCollection deviceProduct{size_, ctx.queue()};
31  algo_.fill(ctx.queue(), deviceProduct);
32 
33  // put the asynchronous product into the event without waiting
34  ctx.emplace(event, deviceToken_, std::move(deviceProduct));
35  }
36 
37  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
39  desc.add<int32_t>("size");
40  descriptions.addWithDefaultLabel(desc);
41  }
42 
43  private:
45  const int32_t size_;
46 
47  // implementation of the algorithm
49  };
50 
51 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
52 
54 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaProducer);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDPutTokenT< cms::alpakatools::Product< Queue, portabletest::TestDeviceCollection > > deviceToken_
void produce(edm::Event &event, edm::EventSetup const &) override
void fill(Queue &queue, portabletest::TestDeviceCollection &collection) const
Definition: TestAlgo.dev.cc:39
Definition: config.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TestAlpakaProducer(edm::ParameterSet const &config)
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:9
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1