On AQUAgpusph the variables are used to track the events, and thus when each tool can be executed.
More...
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
◆ 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
- Parameters
-
◆ 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
◆ 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 |
◆ getWritingEvent()
cl_event Aqua::InputOutput::Variable::getWritingEvent |
( |
| ) |
const |
|
inline |
◆ 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
- Parameters
-
◆ setWritingEvent()
void Aqua::InputOutput::Variable::setWritingEvent |
( |
cl_event | event | ) |
|
|
inline |
◆ 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
-
readonly | true if it is just needed to sync for reading operations, false otherwise |