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<> edm::ProducerBase< edm::stream::EDProducer, Args... >

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 edm::ProducerBase< edm::stream::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_
 
device::EDPutToken< portabletest::TestDeviceCollectiondevicePutToken_
 
device::EDPutToken< portabletest::TestDeviceMultiCollection2devicePutTokenMulti2_
 
device::EDPutToken< portabletest::TestDeviceMultiCollection3devicePutTokenMulti3_
 
device::ESGetToken< cms::alpakatest::AlpakaESTestDataB< Device >, AlpakaESTestRecordBesToken_
 
edm::EDGetTokenT< edmtest::IntProduct > getToken_
 
const int32_t size2_
 
const int32_t size3_
 
const int32_t size_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::stream::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::stream::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 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  size2_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
31  size3_{config.getParameter<edm::ParameterSet>("size").getParameter<int32_t>(
33  getToken_ = consumes(config.getParameter<edm::InputTag>("source"));
34  esToken_ = esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"));
35  devicePutToken_ = produces(config.getParameter<std::string>("productInstanceName"));
36  devicePutTokenMulti2_ = produces(config.getParameter<std::string>("productInstanceName"));
37  devicePutTokenMulti3_ = produces(config.getParameter<std::string>("productInstanceName"));
38  }
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
device::EDPutToken< portabletest::TestDeviceMultiCollection3 > devicePutTokenMulti3_
device::EDPutToken< portabletest::TestDeviceMultiCollection2 > devicePutTokenMulti2_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 60 of file TestAlpakaStreamProducer.cc.

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

60  {
62  desc.add<edm::InputTag>("source");
63  desc.add("eventSetupSource", edm::ESInputTag{});
64  desc.add<std::string>("productInstanceName", "");
65 
67  psetSize.add<int32_t>("alpaka_serial_sync");
68  psetSize.add<int32_t>("alpaka_cuda_async");
69  psetSize.add<int32_t>("alpaka_rocm_async");
70  desc.add("size", psetSize);
71 
72  descriptions.addWithDefaultLabel(desc);
73  }
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<>.

Definition at line 40 of file TestAlpakaStreamProducer.cc.

References algo_, devicePutToken_, devicePutTokenMulti2_, devicePutTokenMulti3_, esToken_, ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fill(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti2(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti3(), ALPAKA_ACCELERATOR_NAMESPACE::device::EventSetup::getData(), getToken_, iEvent, eostools::move(), size2_, size3_, and size_.

40  {
41  [[maybe_unused]] auto inpData = iEvent.getHandle(getToken_);
42  [[maybe_unused]] auto const& esData = iSetup.getData(esToken_);
43 
44  auto deviceProduct = std::make_unique<portabletest::TestDeviceCollection>(size_, iEvent.queue());
45  auto deviceProductMulti2 = std::make_unique<portabletest::TestDeviceMultiCollection2>(
46  portabletest::TestDeviceMultiCollection2::SizesArray{{size_, size2_}}, iEvent.queue());
47  auto deviceProductMulti3 = std::make_unique<portabletest::TestDeviceMultiCollection3>(
48  portabletest::TestDeviceMultiCollection3::SizesArray{{size_, size2_, size3_}}, iEvent.queue());
49 
50  // run the algorithm, potentially asynchronously
51  algo_.fill(iEvent.queue(), *deviceProduct);
52  algo_.fillMulti2(iEvent.queue(), *deviceProductMulti2);
53  algo_.fillMulti3(iEvent.queue(), *deviceProductMulti3);
54 
55  iEvent.put(devicePutToken_, std::move(deviceProduct));
56  iEvent.put(devicePutTokenMulti2_, std::move(deviceProductMulti2));
57  iEvent.put(devicePutTokenMulti3_, std::move(deviceProductMulti3));
58  }
int iEvent
Definition: GenABIO.cc:224
void fillMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:98
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:83
device::EDPutToken< portabletest::TestDeviceMultiCollection3 > devicePutTokenMulti3_
device::EDPutToken< portabletest::TestDeviceMultiCollection2 > devicePutTokenMulti2_
void fillMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 &collection, double xvalue=0.) const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

TestAlgo ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::algo_
private

Definition at line 86 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ devicePutToken_

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

Definition at line 78 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ devicePutTokenMulti2_

device::EDPutToken<portabletest::TestDeviceMultiCollection2> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::devicePutTokenMulti2_
private

Definition at line 79 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ devicePutTokenMulti3_

device::EDPutToken<portabletest::TestDeviceMultiCollection3> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::devicePutTokenMulti3_
private

Definition at line 80 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ esToken_

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

Definition at line 77 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ getToken_

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

Definition at line 76 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ size2_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::size2_
private

Definition at line 82 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ size3_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::size3_
private

Definition at line 83 of file TestAlpakaStreamProducer.cc.

Referenced by produce().

◆ size_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaStreamProducer::size_
private

Definition at line 81 of file TestAlpakaStreamProducer.cc.

Referenced by produce().