CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer:
ALPAKA_ACCELERATOR_NAMESPACE::stream::EDProducer<> ALPAKA_ACCELERATOR_NAMESPACE::ProducerBase< edm::stream::EDProducer, Args... > edm::stream::EDProducer< Args..., edm::Transformer >

Public Member Functions

void produce (device::Event &iEvent, device::EventSetup const &iSetup) override
 
 TestAlpakaStreamProducer (edm::ParameterSet const &config)
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::stream::EDProducer<>
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) final
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::ProducerBase< edm::stream::EDProducer, Args... >
auto produces () noexcept
 
auto produces (std::string instanceName) noexcept
 
- Public Member Functions inherited from edm::stream::EDProducer< Args..., edm::Transformer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

TestAlgo algo_
 
device::EDPutToken< portabletest::TestDeviceCollectiondevicePutToken_
 
device::ESGetToken< cms::alpakatest::AlpakaESTestDataB< Device >, AlpakaESTestRecordBesToken_
 
edm::EDGetTokenT< edmtest::IntProduct > getToken_
 
const int32_t size_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< Args..., edm::Transformer >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

This class demonstrates a stream EDProducer that

Definition at line 23 of file TestAlpakaStreamProducer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaStreamProducer()

ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::TestAlpakaStreamProducer ( edm::ParameterSet const &  config)
inline

Definition at line 25 of file TestAlpakaStreamProducer.cc.

25  : size_{config.getParameter<int32_t>("size")} {
26  getToken_ = consumes(config.getParameter<edm::InputTag>("source"));
27  esToken_ = esConsumes();
29  }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: config.py:1
device::EDPutToken< portabletest::TestDeviceCollection > devicePutToken_
device::ESGetToken< cms::alpakatest::AlpakaESTestDataB< Device >, AlpakaESTestRecordB > esToken_

Member Function Documentation

◆ fillDescriptions()

static void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 43 of file TestAlpakaStreamProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), and submitPVResolutionJobs::desc.

43  {
45  desc.add<edm::InputTag>("source");
46  desc.add<int32_t>("size");
47  descriptions.addWithDefaultLabel(desc);
48  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::produce ( device::Event iEvent,
device::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::EDProducer<>.

Definition at line 31 of file TestAlpakaStreamProducer.cc.

References algo_, devicePutToken_, esToken_, ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fill(), ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), getToken_, iEvent, eostools::move(), and size_.

31  {
32  [[maybe_unused]] auto inpData = iEvent.getHandle(getToken_);
33  [[maybe_unused]] auto const& esData = iSetup.getData(esToken_);
34 
35  auto deviceProduct = std::make_unique<portabletest::TestDeviceCollection>(size_, alpaka::getDev(iEvent.queue()));
36 
37  // run the algorithm, potentially asynchronously
38  algo_.fill(iEvent.queue(), *deviceProduct);
39 
40  iEvent.put(devicePutToken_, std::move(deviceProduct));
41  }
void fill(Queue &queue, portabletest::TestDeviceCollection &collection) const
Definition: TestAlgo.dev.cc:39
int iEvent
Definition: GenABIO.cc:224
device::EDPutToken< portabletest::TestDeviceCollection > devicePutToken_
device::ESGetToken< cms::alpakatest::AlpakaESTestDataB< Device >, AlpakaESTestRecordB > esToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

TestAlgo ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::algo_
private

Definition at line 57 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ devicePutToken_

device::EDPutToken<portabletest::TestDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::devicePutToken_
private

Definition at line 53 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ esToken_

device::ESGetToken<cms::alpakatest::AlpakaESTestDataB<Device>, AlpakaESTestRecordB> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::esToken_
private

Definition at line 52 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ getToken_

edm::EDGetTokenT<edmtest::IntProduct> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::getToken_
private

Definition at line 51 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ size_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::size_
private

Definition at line 54 of file TestAlpakaStreamProducer.cc.

Referenced by produce().