CMS 3D CMS Logo

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 (const ProductBase &data)
 
 ScopedContextBase (edm::StreamID streamID)
 
 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

◆ ScopedContextTask()

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.

196  : ScopedContextBase(state->device(), state->streamPtr()), // don't move, state is re-used afterwards
197  holderHelper_{std::move(waitingTaskHolder)},
198  contextState_{state} {}

References eostools::move().

◆ ~ScopedContextTask()

cms::cuda::ScopedContextTask::~ScopedContextTask ( )

Member Function Documentation

◆ pushNextTask()

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

◆ replaceWaitingTaskHolder()

void cms::cuda::ScopedContextTask::replaceWaitingTaskHolder ( edm::WaitingTaskWithArenaHolder  waitingTaskHolder)
inline

Member Data Documentation

◆ contextState_

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

Definition at line 213 of file ScopedContext.h.

Referenced by pushNextTask().

◆ holderHelper_

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

Definition at line 212 of file ScopedContext.h.

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

cms::cuda::ScopedContextTask::contextState_
ContextState const * contextState_
Definition: ScopedContext.h:213
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
cms::cuda::ScopedContextTask::holderHelper_
impl::ScopedContextHolderHelper holderHelper_
Definition: ScopedContext.h:212
cms::cuda::impl::ScopedContextBase::stream
cudaStream_t stream() const
Definition: ScopedContext.h:34
cms::cuda::impl::ScopedContextHolderHelper::enqueueCallback
void enqueueCallback(int device, cudaStream_t stream)
Definition: ScopedContext.cc:85
cms::cuda::impl::ScopedContextHolderHelper::replaceWaitingTaskHolder
void replaceWaitingTaskHolder(edm::WaitingTaskWithArenaHolder waitingTaskHolder)
Definition: ScopedContext.h:83
cms::cuda::impl::ScopedContextHolderHelper::pushNextTask
void pushNextTask(F &&f, ContextState const *state)
Definition: ScopedContext.h:230
cms::cuda::impl::ScopedContextBase::ScopedContextBase
ScopedContextBase(edm::StreamID streamID)
Definition: ScopedContext.cc:41
eostools.move
def move(src, dest)
Definition: eostools.py:511
cms::cuda::impl::ScopedContextBase::device
int device() const
Definition: ScopedContext.h:28