CMS 3D CMS Logo

TestAlpakaESProducerC.cc
Go to the documentation of this file.
11 
20  public:
21  TestAlpakaESProducerC(edm::ParameterSet const& iConfig) : ESProducer(iConfig) {
22  auto cc = setWhatProduced(this);
23  token_ = cc.consumes();
24  }
25 
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
28  descriptions.addWithDefaultLabel(desc);
29  }
30 
31  std::optional<AlpakaESTestDataCHost> produce(AlpakaESTestRecordC const& iRecord) {
32  auto const& input = iRecord.get(token_);
33 
34  int const size = 5;
35  // TODO: pinned allocation?
36  // TODO: cached allocation?
38  for (int i = 0; i < size; ++i) {
39  product.view()[i].x() = input.value() - i;
40  }
41  return product;
42  }
43 
44  private:
46  };
47 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
48 
49 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(TestAlpakaESProducerC);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
static std::string const input
Definition: EdmProvDump.cc:50
edm::ESGetToken< cms::alpakatest::ESTestDataC, AlpakaESTestRecordC > token_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
alpaka::DevCpu const & host()
Definition: host.h:14
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
Definition: ModuleFactory.h:17
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::optional< AlpakaESTestDataCHost > produce(AlpakaESTestRecordC const &iRecord)