LAMA
|
Class to run a function asynchronously as a asynchronous Task. More...
#include <TaskSyncToken.hpp>
Public Member Functions | |
TaskSyncToken (boost::function< void()> function, int numOmpThreads=0) | |
This constructor starts a function as a Task and gives the SyncToken to wait on the completion. | |
TaskSyncToken () | |
This constructor starts a function as a Task and gives the SyncToken to wait on the completion. | |
virtual void | run (boost::function< void()> function, int numOmpThreads=0) |
virtual | ~TaskSyncToken () |
virtual void | wait () |
Wait for the completion of the Task. | |
virtual bool | probe () const |
Test for the completion of the Task. | |
virtual void | writeAt (std::ostream &stream) const |
Write representation of this object into an output stream. | |
bool | isSynchronized () const |
Query whether token has already been synchronized. | |
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. | |
Private Member Functions | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
logger for this class | |
Private Attributes | |
boost::shared_ptr< Task > | mTask |
Class to run a function asynchronously as a asynchronous Task.
lama::TaskSyncToken::TaskSyncToken | ( | boost::function< void()> | function, |
int | numOmpThreads = 0 |
||
) |
lama::TaskSyncToken::~TaskSyncToken | ( | ) | [virtual] |
References wait().
bool lama::SyncToken::isSynchronized | ( | ) | const [inherited] |
Query whether token has already been synchronized.
References lama::SyncToken::mSynchronized.
Referenced by lama::PGASSyncToken::probe(), lama::CUDAStreamSyncToken::probe(), lama::NoSyncToken::wait(), lama::PGASSyncToken::wait(), wait(), lama::MPISyncToken::wait(), lama::CUDAStreamSyncToken::wait(), lama::NoSyncToken::writeAt(), lama::PGASSyncToken::writeAt(), writeAt(), lama::MPISyncToken::writeAt(), CUDATracerSyncToken::~CUDATracerSyncToken(), lama::MPISyncToken::~MPISyncToken(), lama::NoSyncToken::~NoSyncToken(), and lama::PGASSyncToken::~PGASSyncToken().
lama::TaskSyncToken::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [private] |
logger for this class
Reimplemented from lama::SyncToken.
bool lama::TaskSyncToken::probe | ( | ) | const [virtual] |
void lama::SyncToken::pushAccess | ( | std::auto_ptr< BaseAccess > | access | ) | [inherited] |
Add a read/write access to the token so that LAMA arrays will be locked until synchronization.
References LAMA_ASSERT_ERROR, lama::SyncToken::mAccesses, and lama::SyncToken::mSynchronized.
Referenced by lama::ELLStorage< T >::matrixTimesVectorAsync(), lama::CSRStorage< T >::matrixTimesVectorAsync(), and lama::COOStorage< T >::matrixTimesVectorAsyncToDo().
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::TaskSyncToken::run | ( | boost::function< void()> | function, |
int | numOmpThreads = 0 |
||
) | [virtual] |
References mTask.
Referenced by lama::OpenMPELLUtils::normalGEMV(), and lama::OpenMPELLUtils::sparseGEMV().
void lama::SyncToken::setSynchronized | ( | ) | [protected, inherited] |
This method should be called by base classes after a successful wait.
References LAMA_THROWEXCEPTION, lama::SyncToken::mAccesses, lama::SyncToken::mArrays, lama::SyncToken::mChilds, and lama::SyncToken::mSynchronized.
Referenced by lama::NoSyncToken::wait(), CUDATracerSyncToken::wait(), lama::PGASSyncToken::wait(), wait(), lama::MPISyncToken::wait(), lama::CUDAStreamSyncToken::wait(), and lama::NoSyncToken::~NoSyncToken().
void lama::TaskSyncToken::wait | ( | ) | [virtual] |
Wait for the completion of the Task.
Implements lama::SyncToken.
References lama::SyncToken::isSynchronized(), LAMA_REGION, mTask, and lama::SyncToken::setSynchronized().
Referenced by ~TaskSyncToken().
void lama::TaskSyncToken::writeAt | ( | std::ostream & | stream | ) | const [virtual] |
Write representation of this object into an output stream.
Reimplemented from lama::SyncToken.
References lama::SyncToken::isSynchronized(), and mTask.
boost::shared_ptr<Task> lama::TaskSyncToken::mTask [private] |
Referenced by probe(), run(), TaskSyncToken(), wait(), and writeAt().