boost::compute::wait_list — Stores a list of events.
// In header: <boost/compute/utility/wait_list.hpp> class wait_list { public: // construct/copy/destruct wait_list(); wait_list(const event &); wait_list(const wait_list &); wait_list(wait_list &&); wait_list & operator=(const wait_list &); wait_list & operator=(wait_list &&); ~wait_list(); // public member functions bool empty() const; uint_ size() const; void clear(); const cl_event * get_event_ptr() const; void insert(const event &); template<typename T> void insert(const future< T > &); void wait(); };
The wait_list class stores a set of event objects and can be used to specify dependencies for OpenCL operations or to wait on the host until all of the events have completed.
This class also provides convenience fnuctions for interacting with OpenCL APIs which typically accept event dependencies as a cl_event*
pointer and a cl_uint
size. For example:
wait_list events = ...; clEnqueueNDRangeKernel(..., events.get_event_ptr(), events.size(), ...);
See Also:
wait_list
public
construct/copy/destructwait_list();Creates an empty wait-list.
wait_list(const event & event);Creates a wait-list containing
event
. wait_list(const wait_list & other);Creates a new wait-list as a copy of
other
. wait_list(wait_list && other);Move-constructs a new wait list object from
other
. wait_list & operator=(const wait_list & other);Copies the events in the wait-list from
other
. wait_list & operator=(wait_list && other);Move-assigns the wait list from
other
to *this
. ~wait_list();Destroys the wait-list.
wait_list
public member functionsbool empty() const;Returns
true
if the wait-list is empty. uint_ size() const;Returns the number of events in the wait-list.
void clear();Removes all of the events from the wait-list.
const cl_event * get_event_ptr() const;
Returns a cl_event pointer to the first event in the wait-list. Returns 0
if the wait-list is empty.
This can be used to pass the wait-list to OpenCL functions which expect a cl_event
pointer to refer to a list of events.
void insert(const event & event);Inserts
event
into the wait-list. template<typename T> void insert(const future< T > & future);Inserts the event from
future
into the wait-list. void wait();
Blocks until all of the events in the wait-list have completed.
Does nothing if the wait-list is empty.