CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
cms::alpakatools::ScopedContextAcquire< TQueue, typename > Class Template Reference

#include <ScopedContext.h>

Inheritance diagram for cms::alpakatools::ScopedContextAcquire< TQueue, typename >:
cms::alpakatools::impl::ScopedContextGetterBase< TQueue > cms::alpakatools::impl::ScopedContextBase< TQueue >

Public Types

using Queue = TQueue
 
using ScopedContextGetterBase = impl::ScopedContextGetterBase< Queue >
 
- Public Types inherited from cms::alpakatools::impl::ScopedContextGetterBase< TQueue >
using Queue = TQueue
 
- Public Types inherited from cms::alpakatools::impl::ScopedContextBase< TQueue >
using Device = alpaka::Dev< Queue >
 
using Platform = alpaka::Pltf< Device >
 
using Queue = TQueue
 

Public Member Functions

template<typename F >
void pushNextTask (F &&f)
 
void replaceWaitingTaskHolder (edm::WaitingTaskWithArenaHolder waitingTaskHolder)
 
 ScopedContextAcquire (edm::StreamID streamID, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
 Constructor to create a new queue (no need for context beyond acquire()) More...
 
 ScopedContextAcquire (edm::StreamID streamID, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState< Queue > &state)
 Constructor to create a new queue, and the context is needed after acquire() More...
 
 ScopedContextAcquire (ProductBase< Queue > const &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
 Constructor to (possibly) re-use a queue (no need for context beyond acquire()) More...
 
 ScopedContextAcquire (ProductBase< Queue > const &data, edm::WaitingTaskWithArenaHolder waitingTaskHolder, ContextState< Queue > &state)
 Constructor to (possibly) re-use a queue, and the context is needed after acquire() More...
 
 ~ScopedContextAcquire ()
 
- Public Member Functions inherited from cms::alpakatools::impl::ScopedContextGetterBase< TQueue >
const Tget (Product< Queue, T > const &data)
 
const Tget (edm::Event const &event, edm::EDGetTokenT< Product< Queue, T >> token)
 
- Public Member Functions inherited from cms::alpakatools::impl::ScopedContextBase< TQueue >
Device device () const
 
Queuequeue ()
 
const std::shared_ptr< Queue > & queuePtr () const
 

Private Member Functions

void throwNoState ()
 

Private Attributes

ContextState< Queue > * contextState_ = nullptr
 
impl::ScopedContextHolderHelper holderHelper_
 

Additional Inherited Members

- Protected Member Functions inherited from cms::alpakatools::impl::ScopedContextGetterBase< TQueue >
 ScopedContextGetterBase (Args &&... args)
 
void synchronizeStreams (ProductBase< Queue > const &data)
 
- Protected Member Functions inherited from cms::alpakatools::impl::ScopedContextBase< TQueue >
 ScopedContextBase (ProductBase< Queue > const &data)
 
 ScopedContextBase (std::shared_ptr< Queue > queue)
 
 ScopedContextBase (edm::StreamID streamID)
 

Detailed Description

template<typename TQueue, typename>
class cms::alpakatools::ScopedContextAcquire< TQueue, typename >

The aim of this class is to do necessary per-event "initialization" in ExternalWork acquire():

Definition at line 138 of file ScopedContext.h.

Member Typedef Documentation

◆ Queue

template<typename TQueue , typename >
using cms::alpakatools::ScopedContextAcquire< TQueue, typename >::Queue = TQueue

Definition at line 140 of file ScopedContext.h.

◆ ScopedContextGetterBase

template<typename TQueue , typename >
using cms::alpakatools::ScopedContextAcquire< TQueue, typename >::ScopedContextGetterBase = impl::ScopedContextGetterBase<Queue>

Definition at line 141 of file ScopedContext.h.

Constructor & Destructor Documentation

◆ ScopedContextAcquire() [1/4]

template<typename TQueue , typename >
cms::alpakatools::ScopedContextAcquire< TQueue, typename >::ScopedContextAcquire ( edm::StreamID  streamID,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
inlineexplicit

Constructor to create a new queue (no need for context beyond acquire())

Definition at line 146 of file ScopedContext.h.

References eostools::move().

147  : ScopedContextGetterBase(streamID), holderHelper_{std::move(waitingTaskHolder)} {}
impl::ScopedContextHolderHelper holderHelper_
def move(src, dest)
Definition: eostools.py:511
impl::ScopedContextGetterBase< Queue > ScopedContextGetterBase

◆ ScopedContextAcquire() [2/4]

template<typename TQueue , typename >
cms::alpakatools::ScopedContextAcquire< TQueue, typename >::ScopedContextAcquire ( edm::StreamID  streamID,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder,
ContextState< Queue > &  state 
)
inlineexplicit

Constructor to create a new queue, and the context is needed after acquire()

Definition at line 150 of file ScopedContext.h.

References eostools::move().

153  : ScopedContextGetterBase(streamID), holderHelper_{std::move(waitingTaskHolder)}, contextState_{&state} {}
impl::ScopedContextHolderHelper holderHelper_
ContextState< Queue > * contextState_
def move(src, dest)
Definition: eostools.py:511
impl::ScopedContextGetterBase< Queue > ScopedContextGetterBase

◆ ScopedContextAcquire() [3/4]

template<typename TQueue , typename >
cms::alpakatools::ScopedContextAcquire< TQueue, typename >::ScopedContextAcquire ( ProductBase< Queue > const &  data,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
inlineexplicit

Constructor to (possibly) re-use a queue (no need for context beyond acquire())

Definition at line 156 of file ScopedContext.h.

References eostools::move().

157  : ScopedContextGetterBase(data), holderHelper_{std::move(waitingTaskHolder)} {}
impl::ScopedContextHolderHelper holderHelper_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
def move(src, dest)
Definition: eostools.py:511
impl::ScopedContextGetterBase< Queue > ScopedContextGetterBase

◆ ScopedContextAcquire() [4/4]

template<typename TQueue , typename >
cms::alpakatools::ScopedContextAcquire< TQueue, typename >::ScopedContextAcquire ( ProductBase< Queue > const &  data,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder,
ContextState< Queue > &  state 
)
inlineexplicit

Constructor to (possibly) re-use a queue, and the context is needed after acquire()

Definition at line 160 of file ScopedContext.h.

References eostools::move().

impl::ScopedContextHolderHelper holderHelper_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ContextState< Queue > * contextState_
def move(src, dest)
Definition: eostools.py:511
impl::ScopedContextGetterBase< Queue > ScopedContextGetterBase

◆ ~ScopedContextAcquire()

template<typename TQueue , typename >
cms::alpakatools::ScopedContextAcquire< TQueue, typename >::~ScopedContextAcquire ( )
inline

Member Function Documentation

◆ pushNextTask()

template<typename TQueue , typename >
template<typename F >
void cms::alpakatools::ScopedContextAcquire< TQueue, typename >::pushNextTask ( F &&  f)
inline

◆ replaceWaitingTaskHolder()

template<typename TQueue , typename >
void cms::alpakatools::ScopedContextAcquire< TQueue, typename >::replaceWaitingTaskHolder ( edm::WaitingTaskWithArenaHolder  waitingTaskHolder)
inline

◆ throwNoState()

template<typename TQueue , typename >
void cms::alpakatools::ScopedContextAcquire< TQueue, typename >::throwNoState ( )
inlineprivate

Definition at line 184 of file ScopedContext.h.

References Exception.

Referenced by cms::alpakatools::ScopedContextAcquire< TQueue, typename >::pushNextTask().

184  {
185  throw cms::Exception("LogicError")
186  << "Calling ScopedContextAcquire::insertNextTask() requires ScopedContextAcquire to be constructed with "
187  "ContextState, but that was not the case";
188  }

Member Data Documentation

◆ contextState_

template<typename TQueue , typename >
ContextState<Queue>* cms::alpakatools::ScopedContextAcquire< TQueue, typename >::contextState_ = nullptr
private

◆ holderHelper_

template<typename TQueue , typename >
impl::ScopedContextHolderHelper cms::alpakatools::ScopedContextAcquire< TQueue, typename >::holderHelper_
private