CMS 3D CMS Logo

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

Public Member Functions

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

const edm::EDGetTokenT< cms::alpakatools::Product< Queue, portabletest::TestDeviceCollection > > deviceToken_
 
portabletest::TestHostCollection hostProduct_
 
const edm::EDPutTokenT< portabletest::TestHostCollectionhostToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
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 21 of file TestAlpakaTranscriber.cc.

Constructor & Destructor Documentation

◆ TestAlpakaTranscriber()

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

Definition at line 23 of file TestAlpakaTranscriber.cc.

24  : deviceToken_{consumes(config.getParameter<edm::InputTag>("source"))}, hostToken_{produces()} {}
Definition: config.py:1
const edm::EDGetTokenT< cms::alpakatools::Product< Queue, portabletest::TestDeviceCollection > > deviceToken_
const edm::EDPutTokenT< portabletest::TestHostCollection > hostToken_

Member Function Documentation

◆ acquire()

void ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaTranscriber::acquire ( edm::Event const &  event,
edm::EventSetup const &  setup,
edm::WaitingTaskWithArenaHolder  task 
)
inlineoverride

Definition at line 26 of file TestAlpakaTranscriber.cc.

References PortableHostCollection< T >::buffer(), PortableDeviceCollection< T, TDev, typename >::const_buffer(), deviceToken_, hostProduct_, input, eostools::move(), and TrackValidation_cff::task.

26  {
27  // create a context reusing the same device and queue as the producer of the input collection
28  auto const& input = event.get(deviceToken_);
30 
31  portabletest::TestDeviceCollection const& deviceProduct = ctx.get(input);
32 
33  // allocate a host product based on the metadata of the device product
34  hostProduct_ = portabletest::TestHostCollection{deviceProduct->metadata().size(), ctx.queue()};
35 
36  // FIXME find a way to avoid the copy when the device product is actually a wrapped host prodict
37 
38  // copy the content of the device product to the host product
39  alpaka::memcpy(ctx.queue(), hostProduct_.buffer(), deviceProduct.const_buffer());
40 
41  // do not wait for the asynchronous operation to complete
42  }
PortableCollection< TestSoA > TestDeviceCollection
static std::string const input
Definition: EdmProvDump.cc:50
const edm::EDGetTokenT< cms::alpakatools::Product< Queue, portabletest::TestDeviceCollection > > deviceToken_
def move(src, dest)
Definition: eostools.py:511

◆ fillDescriptions()

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

◆ produce()

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

Definition at line 44 of file TestAlpakaTranscriber.cc.

References hostProduct_, hostToken_, and eostools::move().

44  {
45  // produce() is called once the asynchronous operation has completed, so there is no need for an explicit wait
46  event.emplace(hostToken_, std::move(hostProduct_));
47  }
const edm::EDPutTokenT< portabletest::TestHostCollection > hostToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ deviceToken_

const edm::EDGetTokenT<cms::alpakatools::Product<Queue, portabletest::TestDeviceCollection> > ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaTranscriber::deviceToken_
private

Definition at line 56 of file TestAlpakaTranscriber.cc.

Referenced by acquire().

◆ hostProduct_

portabletest::TestHostCollection ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaTranscriber::hostProduct_
private

Definition at line 60 of file TestAlpakaTranscriber.cc.

Referenced by acquire(), and produce().

◆ hostToken_

const edm::EDPutTokenT<portabletest::TestHostCollection> ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaTranscriber::hostToken_
private

Definition at line 57 of file TestAlpakaTranscriber.cc.

Referenced by produce().