CMS 3D CMS Logo

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