CMS 3D CMS Logo

TestAlpakaProducer.cc
Go to the documentation of this file.
13 
14 #include "TestAlgo.h"
15 
17 
19  public:
21  : deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}
22 
23  void produce(edm::StreamID sid, device::Event& event, device::EventSetup const&) const override {
24  // run the algorithm, potentially asynchronously
25  portabletest::TestDeviceCollection deviceProduct{size_, event.queue()};
26  algo_.fill(event.queue(), deviceProduct);
27 
28  // put the asynchronous product into the event without waiting
29  event.emplace(deviceToken_, std::move(deviceProduct));
30  }
31 
32  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
34  desc.add<int32_t>("size");
35  descriptions.addWithDefaultLabel(desc);
36  }
37 
38  private:
40  const int32_t size_;
41 
42  // implementation of the algorithm
44  };
45 
46 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
47 
49 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaProducer);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID sid, device::Event &event, device::EventSetup const &) const override
Definition: config.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
void fill(Queue &queue, portabletest::TestDeviceCollection &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:42
TestAlpakaProducer(edm::ParameterSet const &config)
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1