MCPcopy Create free account
hub / github.com/boostorg/compute / enqueue_read_buffer

Method enqueue_read_buffer

include/boost/compute/command_queue.hpp:297–327  ·  view source on GitHub ↗

Enqueues a command to read data from \p buffer to host memory. \see_opencl_ref{clEnqueueReadBuffer} \see copy()

Source from the content-addressed store, hash-verified

295 ///
296 /// \see copy()
297 event enqueue_read_buffer(const buffer &buffer,
298 size_t offset,
299 size_t size,
300 void *host_ptr,
301 const wait_list &events = wait_list())
302 {
303 BOOST_ASSERT(m_queue != 0);
304 BOOST_ASSERT(size <= buffer.size());
305 BOOST_ASSERT(buffer.get_context() == this->get_context());
306 BOOST_ASSERT(host_ptr != 0);
307
308 event event_;
309
310 cl_int ret = clEnqueueReadBuffer(
311 m_queue,
312 buffer.get(),
313 CL_TRUE,
314 offset,
315 size,
316 host_ptr,
317 events.size(),
318 events.get_event_ptr(),
319 &event_.get()
320 );
321
322 if(ret != CL_SUCCESS){
323 BOOST_THROW_EXCEPTION(opencl_error(ret));
324 }
325
326 return event_;
327 }
328
329 /// Enqueues a command to read data from \p buffer to host memory. The
330 /// copy will be performed asynchronously.

Callers 5

mainFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
read_single_valueFunction · 0.80
copy_to_hostFunction · 0.80

Calls 6

get_contextMethod · 0.95
wait_listClass · 0.85
opencl_errorClass · 0.85
get_event_ptrMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64