CMS 3D CMS Logo

TestAlpakaESProducerB.cc
Go to the documentation of this file.
11 
23  public:
24  TestAlpakaESProducerB(edm::ParameterSet const& iConfig) : ESProducer(iConfig) {
25  auto cc = setWhatProduced(this, iConfig.getParameter<std::string>("explicitLabel"));
26  token_ = cc.consumes();
27  }
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
31  desc.add("explicitLabel", std::string{});
32  descriptions.addWithDefaultLabel(desc);
33  }
34 
35  std::optional<cms::alpakatest::AlpakaESTestDataB<DevHost>> produce(AlpakaESTestRecordB const& iRecord) {
36  auto const& input = iRecord.get(token_);
37 
38  int const size = 5;
39  // TODO: cached allocation?
40  auto buffer = cms::alpakatools::make_host_buffer<int[], Platform>(size);
41  for (int i = 0; i < size; ++i) {
42  buffer[i] = i + input.value();
43  }
45  }
46 
47  private:
49  };
50 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
51 
52 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(TestAlpakaESProducerB);
size
Write out results.
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::optional< cms::alpakatest::AlpakaESTestDataB< DevHost > > produce(AlpakaESTestRecordB const &iRecord)
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)
edm::ESGetToken< cms::alpakatest::ESTestDataB, AlpakaESTestRecordB > token_
auto setWhatProduced(T *iThis, edm::es::Label const &label={})
Definition: ESProducer.h:39
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
Definition: ModuleFactory.h:17
def move(src, dest)
Definition: eostools.py:511