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< Args > 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< Args >
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)
 
- Static Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::ProducerBase< edm::stream::EDProducer, Args... >
static void prevalidate (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 24 of file TestAlpakaStreamProducer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaStreamProducer()

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

Definition at line 26 of file TestAlpakaStreamProducer.cc.

References EDM_STRINGIZE.

27  : size_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
29  getToken_ = consumes(config.getParameter<edm::InputTag>("source"));
30  esToken_ = esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"));
31  devicePutToken_ = produces(config.getParameter<std::string>("productInstanceName"));
32  }
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_
#define EDM_STRINGIZE(token)
Definition: stringize.h:6

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 46 of file TestAlpakaStreamProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

46  {
48  desc.add<edm::InputTag>("source");
49  desc.add("eventSetupSource", edm::ESInputTag{});
50  desc.add<std::string>("productInstanceName", "");
51 
53  psetSize.add<int32_t>("alpaka_serial_sync");
54  psetSize.add<int32_t>("alpaka_cuda_async");
55  desc.add("size", psetSize);
56 
57  descriptions.addWithDefaultLabel(desc);
58  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

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

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::EDProducer< Args >.

Definition at line 34 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_.

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

Member Data Documentation

◆ algo_

TestAlgo ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::algo_
private

Definition at line 67 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ devicePutToken_

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

Definition at line 63 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ esToken_

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

Definition at line 62 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ getToken_

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

Definition at line 61 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ size_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::size_
private

Definition at line 64 of file TestAlpakaStreamProducer.cc.

Referenced by produce().