CMS 3D CMS Logo

TestAlpakaESProducerA.cc
Go to the documentation of this file.
11 
20  public:
21  TestAlpakaESProducerA(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::unique_ptr<AlpakaESTestDataAHost> produce(AlpakaESTestRecordA const& iRecord) {
32  auto const& input = iRecord.get(token_);
33 
34  int const size = 10;
35  // TODO: pinned allocation?
36  // TODO: cached allocation?
37  auto product = std::make_unique<AlpakaESTestDataAHost>(size, cms::alpakatools::host());
38  for (int i = 0; i < size; ++i) {
39  product->view()[i].z() = input.value() - i;
40  }
41  return product;
42  }
43 
44  private:
46  };
47 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
48 
49 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(TestAlpakaESProducerA);
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
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::unique_ptr< AlpakaESTestDataAHost > produce(AlpakaESTestRecordA const &iRecord)
alpaka::DevCpu const & host()
Definition: host.h:14
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
Definition: ModuleFactory.h:17
edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > token_