CMS 3D CMS Logo

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

Public Member Functions

void produce (edm::StreamID sid, device::Event &event, device::EventSetup const &) const override
 
 TestAlpakaProducer (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::TestDeviceCollectioncollectionToken_
 
const device::EDPutToken< portabletest::TestDeviceMultiCollection2deviceTokenMulti2_
 
const device::EDPutToken< portabletest::TestDeviceMultiCollection3deviceTokenMulti3_
 
const device::EDPutToken< portabletest::TestDeviceObjectobjectToken_
 
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

Definition at line 19 of file TestAlpakaProducer.cc.

Constructor & Destructor Documentation

◆ TestAlpakaProducer()

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

Definition at line 21 of file TestAlpakaProducer.cc.

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

26  size_{config.getParameter<int32_t>("size")},
27  size2_{config.getParameter<int32_t>("size2")},
28  size3_{config.getParameter<int32_t>("size3")} {}
const device::EDPutToken< portabletest::TestDeviceCollection > collectionToken_
Definition: config.py:1
const device::EDPutToken< portabletest::TestDeviceMultiCollection3 > deviceTokenMulti3_
const device::EDPutToken< portabletest::TestDeviceMultiCollection2 > deviceTokenMulti2_
const device::EDPutToken< portabletest::TestDeviceObject > objectToken_
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::TestAlpakaProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 54 of file TestAlpakaProducer.cc.

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

54  {
56  desc.add<int32_t>("size");
57  desc.add<int32_t>("size2");
58  desc.add<int32_t>("size3");
59  descriptions.addWithDefaultLabel(desc);
60  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::produce ( edm::StreamID  sid,
device::Event event,
device::EventSetup const &   
) const
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 30 of file TestAlpakaProducer.cc.

References algo_, collectionToken_, deviceTokenMulti2_, deviceTokenMulti3_, ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fill(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti2(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillMulti3(), ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fillObject(), eostools::move(), objectToken_, size2_, size3_, and size_.

30  {
31  // run the algorithm, potentially asynchronously
32  portabletest::TestDeviceCollection deviceCollection{size_, event.queue()};
33  algo_.fill(event.queue(), deviceCollection);
34 
35  portabletest::TestDeviceObject deviceObject{event.queue()};
36  algo_.fillObject(event.queue(), deviceObject, 5., 12., 13., 42);
37 
38  portabletest::TestDeviceCollection deviceProduct{size_, event.queue()};
39  algo_.fill(event.queue(), deviceProduct);
40 
41  portabletest::TestDeviceMultiCollection2 deviceMultiProduct2{{{size_, size2_}}, event.queue()};
42  algo_.fillMulti2(event.queue(), deviceMultiProduct2);
43 
44  portabletest::TestDeviceMultiCollection3 deviceMultiProduct3{{{size_, size2_, size3_}}, event.queue()};
45  algo_.fillMulti3(event.queue(), deviceMultiProduct3);
46 
47  // put the asynchronous products into the event without waiting
48  event.emplace(collectionToken_, std::move(deviceCollection));
49  event.emplace(objectToken_, std::move(deviceObject));
50  event.emplace(deviceTokenMulti2_, std::move(deviceMultiProduct2));
51  event.emplace(deviceTokenMulti3_, std::move(deviceMultiProduct3));
52  }
void fillObject(Queue &queue, portabletest::TestDeviceObject &object, double x, double y, double z, int32_t id) const
const device::EDPutToken< portabletest::TestDeviceCollection > collectionToken_
PortableCollection< TestSoA > TestDeviceCollection
PortableObject< TestStruct > TestDeviceObject
const device::EDPutToken< portabletest::TestDeviceMultiCollection3 > deviceTokenMulti3_
const device::EDPutToken< portabletest::TestDeviceMultiCollection2 > deviceTokenMulti2_
void fillMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:98
const device::EDPutToken< portabletest::TestDeviceObject > objectToken_
PortableCollection3< TestSoA, TestSoA2, TestSoA3 > TestDeviceMultiCollection3
void fill(Queue &queue, portabletest::TestDeviceCollection &collection, double xvalue=0.) const
Definition: TestAlgo.dev.cc:83
PortableCollection2< TestSoA, TestSoA2 > TestDeviceMultiCollection2
void fillMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 &collection, double xvalue=0.) const
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ algo_

TestAlgo ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::algo_
private

Definition at line 72 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ collectionToken_

const device::EDPutToken<portabletest::TestDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::collectionToken_
private

Definition at line 64 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ deviceTokenMulti2_

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

Definition at line 65 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ deviceTokenMulti3_

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

Definition at line 66 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ objectToken_

const device::EDPutToken<portabletest::TestDeviceObject> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::objectToken_
private

Definition at line 63 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ size2_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::size2_
private

Definition at line 68 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ size3_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::size3_
private

Definition at line 69 of file TestAlpakaProducer.cc.

Referenced by produce().

◆ size_

const int32_t ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::size_
private

Definition at line 67 of file TestAlpakaProducer.cc.

Referenced by produce().