CMS 3D CMS Logo

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