CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
cms::cuda::ScopedContextTask Class Reference

#include <ScopedContext.h>

Inheritance diagram for cms::cuda::ScopedContextTask:
cms::cuda::impl::ScopedContextBase

Public Member Functions

template<typename F >
void pushNextTask (F &&f)
 
void replaceWaitingTaskHolder (edm::WaitingTaskWithArenaHolder waitingTaskHolder)
 
 ScopedContextTask (ContextState const *state, edm::WaitingTaskWithArenaHolder waitingTaskHolder)
 Constructor to re-use the CUDA stream of acquire() (ExternalWork module) More...
 
 ~ScopedContextTask ()
 
- Public Member Functions inherited from cms::cuda::impl::ScopedContextBase
int device () const
 
cudaStream_t stream () const
 
const SharedStreamPtrstreamPtr () const
 

Private Attributes

ContextState const * contextState_
 
impl::ScopedContextHolderHelper holderHelper_
 

Additional Inherited Members

- Protected Member Functions inherited from cms::cuda::impl::ScopedContextBase
 ScopedContextBase (edm::StreamID streamID)
 
 ScopedContextBase (const ProductBase &data)
 
 ScopedContextBase (int device, SharedStreamPtr stream)
 

Detailed Description

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

Definition at line 192 of file ScopedContext.h.

Constructor & Destructor Documentation

cms::cuda::ScopedContextTask::ScopedContextTask ( ContextState const *  state,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
inlineexplicit

Constructor to re-use the CUDA stream of acquire() (ExternalWork module)

Definition at line 195 of file ScopedContext.h.

References eostools::move().

196  : ScopedContextBase(state->device(), state->streamPtr()), // don't move, state is re-used afterwards
197  holderHelper_{std::move(waitingTaskHolder)},
198  contextState_{state} {}
def move
Definition: eostools.py:511
ContextState const * contextState_
impl::ScopedContextHolderHelper holderHelper_
ScopedContextBase(edm::StreamID streamID)
cms::cuda::ScopedContextTask::~ScopedContextTask ( )

Member Function Documentation

template<typename F >
void cms::cuda::ScopedContextTask::pushNextTask ( F &&  f)
inline

Definition at line 203 of file ScopedContext.h.

References contextState_, validate-o2o-wbm::f, holderHelper_, and cms::cuda::impl::ScopedContextHolderHelper::pushNextTask().

Referenced by TestCUDAProducerGPUEWTask::addSimpleWork().

203  {
204  holderHelper_.pushNextTask(std::forward<F>(f), contextState_);
205  }
void pushNextTask(F &&f, ContextState const *state)
ContextState const * contextState_
impl::ScopedContextHolderHelper holderHelper_
void cms::cuda::ScopedContextTask::replaceWaitingTaskHolder ( edm::WaitingTaskWithArenaHolder  waitingTaskHolder)
inline

Definition at line 207 of file ScopedContext.h.

References holderHelper_, eostools::move(), and cms::cuda::impl::ScopedContextHolderHelper::replaceWaitingTaskHolder().

207  {
209  }
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Definition: ScopedContext.h:83
def move
Definition: eostools.py:511
impl::ScopedContextHolderHelper holderHelper_

Member Data Documentation

ContextState const* cms::cuda::ScopedContextTask::contextState_
private

Definition at line 213 of file ScopedContext.h.

Referenced by pushNextTask().

impl::ScopedContextHolderHelper cms::cuda::ScopedContextTask::holderHelper_
private

Definition at line 212 of file ScopedContext.h.

Referenced by pushNextTask(), replaceWaitingTaskHolder(), and ~ScopedContextTask().