CMS 3D CMS Logo

TestAlpakaGlobalProducer.cc
Go to the documentation of this file.
12 
13 #include "TestAlgo.h"
14 
22  public:
24  : esToken_(esConsumes()), deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}
25 
26  void produce(edm::StreamID, device::Event& iEvent, device::EventSetup const& iSetup) const override {
27  [[maybe_unused]] auto const& esData = iSetup.getData(esToken_);
28 
29  portabletest::TestDeviceCollection deviceProduct{size_, alpaka::getDev(iEvent.queue())};
30 
31  // run the algorithm, potentially asynchronously
32  algo_.fill(iEvent.queue(), deviceProduct);
33 
34  iEvent.emplace(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:
46  const int32_t size_;
47 
48  // implementation of the algorithm
50  };
51 
52 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
53 
55 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaGlobalProducer);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
void fill(Queue &queue, portabletest::TestDeviceCollection &collection) const
Definition: TestAlgo.dev.cc:39
Definition: config.py:1
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
int iEvent
Definition: GenABIO.cc:224
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const device::ESGetToken< AlpakaESTestDataA, AlpakaESTestRecordA > esToken_
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:27
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:9
def move(src, dest)
Definition: eostools.py:511