CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TestPortableProducerCUDA Class Reference
Inheritance diagram for TestPortableProducerCUDA:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &event, edm::EventSetup const &) override
 
 TestPortableProducerCUDA (edm::ParameterSet const &config)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 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)
 

Private Attributes

cudatest::TestAlgo algo_
 
const edm::EDPutTokenT< cms::cuda::Product< cudatest::TestDeviceCollection > > deviceToken_
 
const int32_t size_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
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

Definition at line 17 of file TestPortableProducerCUDA.cc.

Constructor & Destructor Documentation

◆ TestPortableProducerCUDA()

TestPortableProducerCUDA::TestPortableProducerCUDA ( edm::ParameterSet const &  config)
inline

Definition at line 19 of file TestPortableProducerCUDA.cc.

20  : deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}
Definition: config.py:1
const edm::EDPutTokenT< cms::cuda::Product< cudatest::TestDeviceCollection > > deviceToken_

Member Function Documentation

◆ fillDescriptions()

static void TestPortableProducerCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 34 of file TestPortableProducerCUDA.cc.

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

34  {
36  desc.add<int32_t>("size");
37  descriptions.addWithDefaultLabel(desc);
38  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void TestPortableProducerCUDA::produce ( edm::Event event,
edm::EventSetup const &   
)
inlineoverride

Definition at line 22 of file TestPortableProducerCUDA.cc.

References algo_, deviceToken_, cudatest::TestAlgo::fill(), eostools::move(), and size_.

22  {
23  // create a context based on the EDM stream number
24  cms::cuda::ScopedContextProduce ctx(event.streamID());
25 
26  // run the algorithm, potentially asynchronously
27  cudatest::TestDeviceCollection deviceProduct{size_, ctx.stream()};
28  algo_.fill(deviceProduct, ctx.stream());
29 
30  // put the asynchronous product into the event without waiting
31  ctx.emplace(event, deviceToken_, std::move(deviceProduct));
32  }
void fill(cudatest::TestDeviceCollection &collection, cudaStream_t stream) const
def move(src, dest)
Definition: eostools.py:511
const edm::EDPutTokenT< cms::cuda::Product< cudatest::TestDeviceCollection > > deviceToken_
Definition: event.py:1

Member Data Documentation

◆ algo_

cudatest::TestAlgo TestPortableProducerCUDA::algo_
private

Definition at line 45 of file TestPortableProducerCUDA.cc.

Referenced by produce().

◆ deviceToken_

const edm::EDPutTokenT<cms::cuda::Product<cudatest::TestDeviceCollection> > TestPortableProducerCUDA::deviceToken_
private

Definition at line 41 of file TestPortableProducerCUDA.cc.

Referenced by produce().

◆ size_

const int32_t TestPortableProducerCUDA::size_
private

Definition at line 42 of file TestPortableProducerCUDA.cc.

Referenced by produce().