CMS 3D CMS Logo

TestAlpakaGlobalProducer.cc
Go to the documentation of this file.
12 
13 #include "TestAlgo.h"
14 
22  public:
24  : esToken_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
26  size_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
28 
29  void produce(edm::StreamID, device::Event& iEvent, device::EventSetup const& iSetup) const override {
30  [[maybe_unused]] auto const& esData = iSetup.getData(esToken_);
31 
32  portabletest::TestDeviceCollection deviceProduct{size_, iEvent.queue()};
33 
34  // run the algorithm, potentially asynchronously
35  algo_.fill(iEvent.queue(), deviceProduct);
36 
37  iEvent.emplace(deviceToken_, std::move(deviceProduct));
38  }
39 
40  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
42  desc.add("eventSetupSource", edm::ESInputTag{});
43 
45  psetSize.add<int32_t>("alpaka_serial_sync");
46  psetSize.add<int32_t>("alpaka_cuda_async");
47  desc.add("size", psetSize);
48 
49  descriptions.addWithDefaultLabel(desc);
50  }
51 
52  private:
55  const int32_t size_;
56 
57  // implementation of the algorithm
59  };
60 
61 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
62 
64 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaGlobalProducer);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
Definition: config.py:1
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
int iEvent
Definition: GenABIO.cc:224
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
void fill(Queue &queue, portabletest::TestDeviceCollection &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:42
#define EDM_STRINGIZE(token)
Definition: stringize.h:6
HLT enums.
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordA > esToken_
def move(src, dest)
Definition: eostools.py:511