Clover Git
OpenCL 1.1 software implementation
Public Member Functions | Private Attributes

Coal::UserEvent Class Reference

User event. More...

#include <events.h>

Inheritance diagram for Coal::UserEvent:
Collaboration diagram for Coal::UserEvent:

List of all members.

Public Member Functions

 UserEvent (Context *context, cl_int *errcode_ret)
Type type () const
 Say the event is a Coal::Event::User one.
Contextcontext () 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

Contextp_context
std::vector< CommandQueue * > p_dependent_queues

Detailed Description

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.

Definition at line 661 of file events.h.


Constructor & Destructor Documentation

UserEvent::UserEvent ( Context context,
cl_int *  errcode_ret 
)

Definition at line 881 of file events.cpp.


Member Function Documentation

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

Parameters:
queueCoal::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

Context of this event.

Definition at line 890 of file events.cpp.

References p_context.

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.


Member Data Documentation

Definition at line 680 of file events.h.

Referenced by context().

Definition at line 681 of file events.h.

Referenced by addDependentCommandQueue(), and flushQueues().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines