Esempio n. 1
0
command_queue default_queue()
{
  static command_queue queue;
  if (!queue.get())
  {
    context c = default_context();
    device d = default_device();
    queue = command_queue(c, d);
  }
  return queue;
}
Esempio n. 2
0
/// Enqueues a command to release the specified OpenGL memory objects.
///
/// \see_opencl_ref{clEnqueueReleaseGLObjects}
inline void opengl_enqueue_release_gl_objects(size_t num_objects,
                                              const cl_mem *mem_objects,
                                              command_queue &queue)
{
    cl_int ret = clEnqueueReleaseGLObjects(queue.get(),
                                           num_objects,
                                           mem_objects,
                                           0,
                                           0,
                                           0);
    if(ret != CL_SUCCESS){
        BOOST_THROW_EXCEPTION(runtime_exception(ret));
    }
}
Esempio n. 3
0
/// Enqueues a command to release the specified OpenGL memory objects.
///
/// \see_opencl_ref{clEnqueueReleaseGLObjects}
inline event opengl_enqueue_release_gl_objects(size_t num_objects,
                                              const cl_mem *mem_objects,
                                              command_queue &queue,
                                              const wait_list &events = wait_list())
{
    BOOST_ASSERT(queue != 0);

    event event_;

    cl_int ret = clEnqueueReleaseGLObjects(queue.get(),
                                           num_objects,
                                           mem_objects,
                                           events.size(),
                                           events.get_event_ptr(),
                                           &event_.get());
    if(ret != CL_SUCCESS){
        BOOST_THROW_EXCEPTION(opencl_error(ret));
    }

    return event_;
}
Esempio n. 4
0
 bool operator()(const command_queue &a, const command_queue &b) const {
     return a.get() < b.get();
 }