CMS 3D CMS Logo

TestAlpakaESProducerA.cc
Go to the documentation of this file.
11 
19  public:
20  TestAlpakaESProducerA(edm::ParameterSet const& iConfig) : ESProducer(iConfig) {
21  auto cc = setWhatProduced(this);
22  token_ = cc.consumes();
23  }
24 
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
27  descriptions.addWithDefaultLabel(desc);
28  }
29 
30  std::unique_ptr<AlpakaESTestDataAHost> produce(AlpakaESTestRecordA const& iRecord) {
31  auto const& input = iRecord.get(token_);
32 
33  int const size = 10;
34  // TODO: pinned allocation?
35  // TODO: cached allocation?
36  auto product = std::make_unique<AlpakaESTestDataAHost>(size, cms::alpakatools::host());
37  for (int i = 0; i < size; ++i) {
38  product->view()[i].z() = input.value() - i;
39  }
40  return product;
41  }
42 
43  private:
45  };
46 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
47 
48 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(TestAlpakaESProducerA);
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
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: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
edm::ESGetToken< cms::alpakatest::ESTestDataA, AlpakaESTestRecordA > token_