Clover Git
OpenCL 1.1 software implementation
|
User event. More...
#include <events.h>
Public Member Functions | |
UserEvent (Context *context, cl_int *errcode_ret) | |
Type | type () const |
Say the event is a Coal::Event::User one. | |
Context * | context () const |
Context of this event. | |
void | flushQueues () |
Call Coal::CommandQueue::pushEventsOnDevice() for each command queue in which this event is queued. | |
void | addDependentCommandQueue (CommandQueue *queue) |
Add a Coal::CommandQueue that will have to be flushed when this event becomes completed. | |
Private Attributes | |
Context * | p_context |
std::vector< CommandQueue * > | p_dependent_queues |
User event.
This event is a bit special as it is created by a call to clCreateUserEvent()
and doesn't belong to an event queue. Thus, a mean had to be found for all to work.
The solution is the addDependentCommandQueue()
function, called every time the user event is added to a command queue. When this event becomes completed, flushQueues()
is called to allow all the Coal::CommandQueue
objects containing this event to push more events on their device.
This way, command queues are not blocked by user events.
UserEvent::UserEvent | ( | Context * | context, |
cl_int * | errcode_ret | ||
) |
Definition at line 881 of file events.cpp.
void UserEvent::addDependentCommandQueue | ( | CommandQueue * | queue | ) |
Add a Coal::CommandQueue
that will have to be flushed when this event becomes completed.
See the long description of this class for a complete explanation
queue | Coal::CommandQueue to add in the list of queues to flush |
Definition at line 895 of file events.cpp.
References p_dependent_queues.
Context * UserEvent::context | ( | ) | const |
void UserEvent::flushQueues | ( | ) |
Call Coal::CommandQueue::pushEventsOnDevice()
for each command queue in which this event is queued.
Definition at line 906 of file events.cpp.
References p_dependent_queues.
Event::Type UserEvent::type | ( | ) | const [virtual] |
Say the event is a Coal::Event::User
one.
Implements Coal::Event.
Definition at line 885 of file events.cpp.
References Coal::Event::User.
Context* Coal::UserEvent::p_context [private] |
std::vector<CommandQueue *> Coal::UserEvent::p_dependent_queues [private] |
Definition at line 681 of file events.h.
Referenced by addDependentCommandQueue(), and flushQueues().