CMS 3D CMS Logo

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

Public Member Functions

void acquire (device::Event const &iEvent, device::EventSetup const &iSetup) override
 
void produce (device::Event &iEvent, device::EventSetup const &iSetup) override
 
 TestAlpakaStreamSynchronizingProducer (edm::ParameterSet const &iConfig)
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>
void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder holder) final
 
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) final
 
- Public Member Functions inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const device::ESGetToken< AlpakaESTestDataDDevice, AlpakaESTestRecordDesTokenDevice_
 
int const expectedInt_
 
TestHelperClass helper_
 
cms::alpakatest::TestHostOnlyHelperClass const hostHelper_
 
const edm::EDPutTokenT< portabletest::TestHostCollectionputToken_
 
const edm::EDPutTokenT< portabletest::TestHostMultiCollection2putTokenMulti2_
 
const edm::EDPutTokenT< portabletest::TestHostMultiCollection3putTokenMulti3_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
auto produces () noexcept
 
ProducesCollector producesCollector ()
 

Detailed Description

This class demonstrates a stream EDProducer that

Definition at line 25 of file TestAlpakaStreamSynchronizingProducer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaStreamSynchronizingProducer()

ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::TestAlpakaStreamSynchronizingProducer ( edm::ParameterSet const &  iConfig)
inline

Definition at line 27 of file TestAlpakaStreamSynchronizingProducer.cc.

References edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >::produces().

32  helper_{iConfig, consumesCollector()},
33  hostHelper_{iConfig, consumesCollector()},
34  expectedInt_{iConfig.getParameter<int>("expectedInt")} {}
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::ESGetToken< AlpakaESTestDataDDevice, AlpakaESTestRecordD > esTokenDevice_
const edm::EDPutTokenT< portabletest::TestHostMultiCollection3 > putTokenMulti3_
const edm::EDPutTokenT< portabletest::TestHostMultiCollection2 > putTokenMulti2_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

Member Function Documentation

◆ acquire()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::acquire ( device::Event const &  iEvent,
device::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 36 of file TestAlpakaStreamSynchronizingProducer.cc.

References esTokenDevice_, Exception, expectedInt_, ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), helper_, hostHelper_, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::makeAsync(), cms::alpakatest::TestHostOnlyHelperClass::run(), and relativeConstraints::value.

36  {
37  [[maybe_unused]] auto const& esData = iSetup.getData(esTokenDevice_);
38 
39  int const value = hostHelper_.run(iEvent, iSetup);
40  if (value != expectedInt_) {
41  throw cms::Exception("Assert") << "Expected value " << expectedInt_ << ", but got " << value;
42  }
43 
44  helper_.makeAsync(iEvent, iSetup);
45  }
void makeAsync(device::Event const &iEvent, device::EventSetup const &iSetup)
const device::ESGetToken< AlpakaESTestDataDDevice, AlpakaESTestRecordD > esTokenDevice_
int iEvent
Definition: GenABIO.cc:224
int run(edm::Event const &iEvent, edm::EventSetup const &iSetup) const
Definition: value.py:1

◆ fillDescriptions()

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

◆ produce()

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

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 47 of file TestAlpakaStreamSynchronizingProducer.cc.

References helper_, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFrom(), ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFromMulti2(), ALPAKA_ACCELERATOR_NAMESPACE::TestHelperClass::moveFromMulti3(), putToken_, putTokenMulti2_, and putTokenMulti3_.

47  {
48  iEvent.emplace(putToken_, helper_.moveFrom());
51  }
const edm::EDPutTokenT< portabletest::TestHostMultiCollection3 > putTokenMulti3_
portabletest::TestHostMultiCollection2 moveFromMulti2()
int iEvent
Definition: GenABIO.cc:224
const edm::EDPutTokenT< portabletest::TestHostMultiCollection2 > putTokenMulti2_
portabletest::TestHostCollection moveFrom()
portabletest::TestHostMultiCollection3 moveFromMulti3()

Member Data Documentation

◆ esTokenDevice_

const device::ESGetToken<AlpakaESTestDataDDevice, AlpakaESTestRecordD> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::esTokenDevice_
private

Definition at line 62 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by acquire().

◆ expectedInt_

int const ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::expectedInt_
private

Definition at line 69 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by acquire().

◆ helper_

TestHelperClass ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::helper_
private

Definition at line 67 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by acquire(), and produce().

◆ hostHelper_

cms::alpakatest::TestHostOnlyHelperClass const ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::hostHelper_
private

Definition at line 68 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by acquire().

◆ putToken_

const edm::EDPutTokenT<portabletest::TestHostCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::putToken_
private

Definition at line 63 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by produce().

◆ putTokenMulti2_

const edm::EDPutTokenT<portabletest::TestHostMultiCollection2> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::putTokenMulti2_
private

Definition at line 64 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by produce().

◆ putTokenMulti3_

const edm::EDPutTokenT<portabletest::TestHostMultiCollection3> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamSynchronizingProducer::putTokenMulti3_
private

Definition at line 65 of file TestAlpakaStreamSynchronizingProducer.cc.

Referenced by produce().