CMS 3D CMS Logo

TestAlpakaProducer.cc
Go to the documentation of this file.
14 
15 #include "TestAlgo.h"
16 
18 
20  public:
22  : deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}
23 
24  void produce(device::Event& event, device::EventSetup const&) override {
25  // run the algorithm, potentially asynchronously
26  portabletest::TestDeviceCollection deviceProduct{size_, event.queue()};
27  algo_.fill(event.queue(), deviceProduct);
28 
29  // put the asynchronous product into the event without waiting
30  event.emplace(deviceToken_, std::move(deviceProduct));
31  }
32 
33  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
35  desc.add<int32_t>("size");
36  descriptions.addWithDefaultLabel(desc);
37  }
38 
39  private:
41  const int32_t size_;
42 
43  // implementation of the algorithm
45  };
46 
47 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
48 
50 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaProducer);
void produce(device::Event &event, device::EventSetup const &) override
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void fill(Queue &queue, portabletest::TestDeviceCollection &collection) const
Definition: TestAlgo.dev.cc:39
Definition: config.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
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