CMS 3D CMS Logo

TestAlpakaGlobalProducerE.cc
Go to the documentation of this file.
12 
13 #include "TestAlgo.h"
14 
23  public:
25  : esToken_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
26  getToken_(consumes(config.getParameter<edm::InputTag>("source"))),
27  putToken_{produces()} {}
28 
29  void produce(edm::StreamID, device::Event& iEvent, device::EventSetup const& iSetup) const override {
30  auto const& esData = iSetup.getData(esToken_);
31  auto const& input = iEvent.get(getToken_);
32 
33  // run the algorithm, potentially asynchronously
34  auto deviceProduct = algo_.update(iEvent.queue(), input, esData);
35 
36  iEvent.emplace(putToken_, std::move(deviceProduct));
37  }
38 
39  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
41  desc.add("eventSetupSource", edm::ESInputTag{});
42  desc.add("source", edm::InputTag{});
43 
44  descriptions.addWithDefaultLabel(desc);
45  }
46 
47  private:
51 
52  // implementation of the algorithm
54  };
55 
56 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
57 
59 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaGlobalProducerE);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::EDPutToken< portabletest::TestDeviceCollection > putToken_
const device::ESGetToken< AlpakaESTestDataEDevice, AlpakaESTestRecordC > esToken_
void produce(edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
Definition: config.py:1
portabletest::TestDeviceCollection update(Queue &queue, portabletest::TestDeviceCollection const &input, AlpakaESTestDataEDevice const &esData) const
static std::string const input
Definition: EdmProvDump.cc:50
int iEvent
Definition: GenABIO.cc:224
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
HLT enums.
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
def move(src, dest)
Definition: eostools.py:511