CMS 3D CMS Logo

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

Public Member Functions

void produce (edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
 
 TestAlpakaGlobalProducer (edm::ParameterSet const &config)
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>
void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &iSetup) const final
 
- Public Member Functions inherited from edm::ProducerBase< edm::global::EDProducer, 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

TestAlgo algo_
 
const device::EDPutToken< portabletest::TestDeviceCollectiondeviceToken_
 
const device::EDPutToken< portabletest::TestDeviceMultiCollection2deviceTokenMulti2_
 
const device::EDPutToken< portabletest::TestDeviceMultiCollection3deviceTokenMulti3_
 
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordAesToken_
 
const int32_t size2_
 
const int32_t size3_
 
const int32_t size_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::global::EDProducer, 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::global::EDProducer, 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 global EDProducer that

Definition at line 21 of file TestAlpakaGlobalProducer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaGlobalProducer()

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

Definition at line 23 of file TestAlpakaGlobalProducer.cc.

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

24  : esToken_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
28  size_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
30  size2_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
32  size3_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
const device::EDPutToken< portabletest::TestDeviceMultiCollection3 > deviceTokenMulti3_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: config.py:1
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
#define EDM_STRINGIZE(token)
Definition: stringize.h:6
const device::EDPutToken< portabletest::TestDeviceMultiCollection2 > deviceTokenMulti2_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordA > esToken_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 52 of file TestAlpakaGlobalProducer.cc.

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

52  {
54  desc.add("eventSetupSource", edm::ESInputTag{});
55 
57  psetSize.add<int32_t>("alpaka_serial_sync");
58  psetSize.add<int32_t>("alpaka_cuda_async");
59  psetSize.add<int32_t>("alpaka_rocm_async");
60  desc.add("size", psetSize);
61 
62  descriptions.addWithDefaultLabel(desc);
63  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::produce ( edm::StreamID  ,
device::Event iEvent,
device::EventSetup const &  iSetup 
) const
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 35 of file TestAlpakaGlobalProducer.cc.

References algo_, deviceToken_, deviceTokenMulti2_, deviceTokenMulti3_, esToken_, ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fill(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti2(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti3(), ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), iEvent, eostools::move(), size2_, size3_, and size_.

35  {
36  [[maybe_unused]] auto const& esData = iSetup.getData(esToken_);
37 
38  portabletest::TestDeviceCollection deviceProduct{size_, iEvent.queue()};
39  portabletest::TestDeviceMultiCollection2 deviceProductMulti2{{{size_, size2_}}, iEvent.queue()};
40  portabletest::TestDeviceMultiCollection3 deviceProductMulti3{{{size_, size2_, size3_}}, iEvent.queue()};
41 
42  // run the algorithm, potentially asynchronously
43  algo_.fill(iEvent.queue(), deviceProduct);
44  algo_.fillMulti2(iEvent.queue(), deviceProductMulti2);
45  algo_.fillMulti3(iEvent.queue(), deviceProductMulti3);
46 
47  iEvent.emplace(deviceToken_, std::move(deviceProduct));
48  iEvent.emplace(deviceTokenMulti2_, std::move(deviceProductMulti2));
49  iEvent.emplace(deviceTokenMulti3_, std::move(deviceProductMulti3));
50  }
const device::EDPutToken< portabletest::TestDeviceMultiCollection3 > deviceTokenMulti3_
const device::EDPutToken< portabletest::TestDeviceCollection > deviceToken_
PortableCollection< TestSoA > TestDeviceCollection
int iEvent
Definition: GenABIO.cc:224
void fillMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:98
PortableCollection3< TestSoA, TestSoA2, TestSoA3 > TestDeviceMultiCollection3
void fill(Queue &queue, portabletest::TestDeviceCollection &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:83
const device::EDPutToken< portabletest::TestDeviceMultiCollection2 > deviceTokenMulti2_
PortableCollection2< TestSoA, TestSoA2 > TestDeviceMultiCollection2
void fillMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 &collection, double xvalue=0.) const
const device::ESGetToken< AlpakaESTestDataADevice, AlpakaESTestRecordA > esToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

TestAlgo ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::algo_
private

Definition at line 75 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ deviceToken_

const device::EDPutToken<portabletest::TestDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::deviceToken_
private

Definition at line 67 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ deviceTokenMulti2_

const device::EDPutToken<portabletest::TestDeviceMultiCollection2> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::deviceTokenMulti2_
private

Definition at line 68 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ deviceTokenMulti3_

const device::EDPutToken<portabletest::TestDeviceMultiCollection3> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::deviceTokenMulti3_
private

Definition at line 69 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ esToken_

const device::ESGetToken<AlpakaESTestDataADevice, AlpakaESTestRecordA> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::esToken_
private

Definition at line 66 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ size2_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::size2_
private

Definition at line 71 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ size3_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::size3_
private

Definition at line 72 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().

◆ size_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaGlobalProducer::size_
private

Definition at line 70 of file TestAlpakaGlobalProducer.cc.

Referenced by produce().