PrevUpHomeNext

Class wait_list

boost::compute::wait_list — Stores a list of events.

Synopsis

// 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();
};

Description

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:

event, future<T>

wait_list public construct/copy/destruct

  1. wait_list();
    Creates an empty wait-list.
  2. wait_list(const event & event);
    Creates a wait-list containing event.
  3. wait_list(const wait_list & other);
    Creates a new wait-list as a copy of other.
  4. wait_list(wait_list && other);
    Move-constructs a new wait list object from other.
  5. wait_list & operator=(const wait_list & other);
    Copies the events in the wait-list from other.
  6. wait_list & operator=(wait_list && other);
    Move-assigns the wait list from other to *this.
  7. ~wait_list();
    Destroys the wait-list.

wait_list public member functions

  1. bool empty() const;
    Returns true if the wait-list is empty.
  2. uint_ size() const;
    Returns the number of events in the wait-list.
  3. void clear();
    Removes all of the events from the wait-list.
  4. 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.

  5. void insert(const event & event);
    Inserts event into the wait-list.
  6. template<typename T> void insert(const future< T > & future);
    Inserts the event from future into the wait-list.
  7. void wait();

    Blocks until all of the events in the wait-list have completed.

    Does nothing if the wait-list is empty.


PrevUpHomeNext