CMS 3D CMS Logo

TestAlpakaESProducerC.cc
Go to the documentation of this file.
14 
23  public:
24  TestAlpakaESProducerC(edm::ParameterSet const& iConfig) : ESProducer(iConfig) {
25  auto cc = setWhatProduced(this);
26  token_ = cc.consumes();
27  }
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
31  descriptions.addWithDefaultLabel(desc);
32  }
33 
34  std::optional<AlpakaESTestDataCHost> produce(AlpakaESTestRecordC const& iRecord) {
35  auto const& input = iRecord.get(token_);
36 
37  int const size = 5;
38  // TODO: pinned allocation?
39  // TODO: cached allocation?
41  for (int i = 0; i < size; ++i) {
42  product.view()[i].x() = input.value() - i;
43  }
44  return product;
45  }
46 
47  private:
49  };
50 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
51 
52 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(TestAlpakaESProducerC);
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:26
auto setWhatProduced(T *iThis, edm::es::Label const &label={})
Definition: ESProducer.h:40
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
Definition: ModuleFactory.h:17
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::optional< AlpakaESTestDataCHost > produce(AlpakaESTestRecordC const &iRecord)