LAMA
lama::CUDAStreamSyncToken Class Reference

Class that sycnchronizes with a CUDA stream. More...

#include <CUDAStreamSyncToken.hpp>

Inheritance diagram for lama::CUDAStreamSyncToken:

Public Member Functions

 CUDAStreamSyncToken (CUDAContextPtr context, CUstream stream)
 Constructor for a sychronization token.
virtual ~CUDAStreamSyncToken ()
virtual void wait ()
 Method to wait on the completion of an operation.
virtual bool probe () const
 Predicate to ask if an asynchronous operation is already completed.
cudaStream_t getCUDAStream () const
void createTimingEvent (CUevent &event) const
void createEvent (CUevent &event) const
void getTime (float *time, CUevent &startEvent, CUevent &stopEvent) const
bool probeEvent (const CUevent &stopEvent) const
void recordEvent (const CUevent event)
bool queryEvent (const CUevent event) const
void synchronizeEvent (const CUevent event) const
bool isSynchronized () const
 Query whether token has already been synchronized.
virtual void writeAt (std::ostream &stream) const
 Base class provides a default implementation for the virtual method of Printable.
void pushAccess (std::auto_ptr< BaseAccess > access)
 Add a read/write access to the token so that LAMA arrays will be locked until synchronization.
void pushArray (std::auto_ptr< _LAMAArray > array)
 Add a LAMA array that will be free after synchronization.
void pushSyncToken (std::auto_ptr< SyncToken > syncToken)
 Add a Synctoken that will be synchronized after synchronization.

Protected Member Functions

void setSynchronized ()
 This method should be called by base classes after a successful wait.
 LAMA_LOG_DECL_STATIC_LOGGER (logger)
 logger for this class

Private Attributes

CUDAContextPtr mCUDAContext
const CUstream mStream
CUevent mEvent

Friends

class CUDAStreamSyncTokenPtr

Detailed Description

Class that sycnchronizes with a CUDA stream.


Constructor & Destructor Documentation

Constructor for a sychronization token.

Parameters:
[in]contextis the CUDAcontext of the stream
[in]isthe handle of the CUDA stream.

A pointer to the CUDA context is required to enable/disable it.


Member Function Documentation

void lama::CUDAStreamSyncToken::getTime ( float *  time,
CUevent startEvent,
CUevent stopEvent 
) const
lama::SyncToken::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [protected, inherited]

logger for this class

Reimplemented in lama::TaskSyncToken, and CUDATracerSyncToken.

bool lama::CUDAStreamSyncToken::probe ( ) const [virtual]

Predicate to ask if an asynchronous operation is already completed.

Implements lama::SyncToken.

References lama::SyncToken::isSynchronized(), mEvent, and probeEvent().

void lama::SyncToken::pushAccess ( std::auto_ptr< BaseAccess access) [inherited]
void lama::SyncToken::pushArray ( std::auto_ptr< _LAMAArray array) [inherited]

Add a LAMA array that will be free after synchronization.

References LAMA_ASSERT_ERROR, lama::SyncToken::mArrays, and lama::SyncToken::mSynchronized.

void lama::SyncToken::pushSyncToken ( std::auto_ptr< SyncToken syncToken) [inherited]

Add a Synctoken that will be synchronized after synchronization.

References LAMA_ASSERT_ERROR, lama::SyncToken::mChilds, and lama::SyncToken::mSynchronized.

Referenced by CUDATracerHelper< Tracer >::CUDATracerHelper().

void lama::SyncToken::writeAt ( std::ostream &  stream) const [virtual, inherited]

Base class provides a default implementation for the virtual method of Printable.

Reimplemented from Printable.

Reimplemented in lama::MPISyncToken, lama::TaskSyncToken, lama::PGASSyncToken, and lama::NoSyncToken.

References lama::SyncToken::mSynchronized.


Friends And Related Function Documentation

friend class CUDAStreamSyncTokenPtr [friend]

Field Documentation


The documentation for this class was generated from the following files: