AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Events tracked on variables

On AQUAgpusph the variables are used to track the events, and thus when each tool can be executed. More...

Functions

void Aqua::InputOutput::Variable::setEvent (cl_event event)
 Set the variable current writing event.
void Aqua::InputOutput::Variable::setWritingEvent (cl_event event)
 Alias of InputOutput::Variable::setEvent()
cl_event Aqua::InputOutput::Variable::getEvent () const
 Returns the last writing event associated to this variable.
cl_event Aqua::InputOutput::Variable::getWritingEvent () const
 Alias of InputOutput::Variable::getEvent()
void Aqua::InputOutput::Variable::addReadingEvent (cl_event event)
 Add a new reading event to the variable.
std::vector< cl_event > Aqua::InputOutput::Variable::getReadingEvents () const
 Get the list of reading events.
void Aqua::InputOutput::Variable::sync (bool readonly=false)
 Wait for variable reading and writing events to be completed.
void Aqua::InputOutput::Variable::cleanReadingEvents ()
 Clean up the list of reading events.

Detailed Description

On AQUAgpusph the variables are used to track the events, and thus when each tool can be executed.

The rationale is that each variable can store 2 types of events, reading events and writing events. Along this line, reading processes shall only wait for the last writing event, while writing processes shall wait for both the last writing event as well all the recorded reading events

Function Documentation

◆ addReadingEvent()

void Aqua::InputOutput::Variable::addReadingEvent ( cl_event event)

Add a new reading event to the variable.

clRetainEvent() is called on the provided event.

On top of that, the list of reading events is traversed, calling clReleaseEvent() on those completed and droping them from the list

Remarks
Events are used even for non-OpenCL variables
Parameters
eventOpenCL event
Here is the call graph for this function:

◆ cleanReadingEvents()

void Aqua::InputOutput::Variable::cleanReadingEvents ( )
protected

Clean up the list of reading events.

All the events marked as completed are released (calling clReleaseEvent()) and dropped from the list

Here is the call graph for this function:

◆ getEvent()

cl_event Aqua::InputOutput::Variable::getEvent ( ) const
inline

Returns the last writing event associated to this variable.

Returns
OpenCL event

◆ getReadingEvents()

std::vector< cl_event > Aqua::InputOutput::Variable::getReadingEvents ( ) const
inline

Get the list of reading events.

The list of reading events is only valid until InputOutput::Variable::addReadingEvent() is called again

Remarks
Events are used even for non-OpenCL variables
Parameters
eventOpenCL event

◆ getWritingEvent()

cl_event Aqua::InputOutput::Variable::getWritingEvent ( ) const
inline

Alias of InputOutput::Variable::getEvent()

Here is the call graph for this function:

◆ setEvent()

void Aqua::InputOutput::Variable::setEvent ( cl_event event)

Set the variable current writing event.

clRetainEvent() is called on the provided event, while clReleaseEvent() is called on the eventually previous stored event

Remarks
Events are used even for non-OpenCL variables
Parameters
eventOpenCL event
Here is the call graph for this function:

◆ setWritingEvent()

void Aqua::InputOutput::Variable::setWritingEvent ( cl_event event)
inline

Alias of InputOutput::Variable::setEvent()

Here is the call graph for this function:

◆ sync()

void Aqua::InputOutput::Variable::sync ( bool readonly = false)

Wait for variable reading and writing events to be completed.

This function is tracking the syncing state, so clWaitForEvents() is not called until the previous syncing has been completed.

This is obviously a blocking function

Parameters
readonlytrue if it is just needed to sync for reading operations, false otherwise
Here is the call graph for this function: