LAMA
lama::TaskSyncToken Class Reference

Class to run a function asynchronously as a asynchronous Task. More...

#include <TaskSyncToken.hpp>

Inheritance diagram for lama::TaskSyncToken:

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< TaskmTask

Detailed Description

Class to run a function asynchronously as a asynchronous Task.


Constructor & Destructor Documentation

lama::TaskSyncToken::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.

References mTask.

This constructor starts a function as a Task and gives the SyncToken to wait on the completion.

References wait().


Member Function Documentation

logger for this class

Reimplemented from lama::SyncToken.

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

Test for the completion of the Task.

Implements lama::SyncToken.

References mTask.

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::TaskSyncToken::run ( boost::function< void()>  function,
int  numOmpThreads = 0 
) [virtual]
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.


Field Documentation

boost::shared_ptr<Task> lama::TaskSyncToken::mTask [private]

Referenced by probe(), run(), TaskSyncToken(), wait(), and writeAt().


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