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

Method enqueue_read_buffer

include/boost/compute/command_queue.hpp:252–282  ·  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

250 ///
251 /// \see copy()
252 event enqueue_read_buffer(const buffer &buffer,
253 size_t offset,
254 size_t size,
255 void *host_ptr,
256 const wait_list &events = wait_list())
257 {
258 BOOST_ASSERT(m_queue != 0);
259 BOOST_ASSERT(size <= buffer.size());
260 BOOST_ASSERT(buffer.get_context() == this->get_context());
261 BOOST_ASSERT(host_ptr != 0);
262
263 event event_;
264
265 cl_int ret = clEnqueueReadBuffer(
266 m_queue,
267 buffer.get(),
268 CL_TRUE,
269 offset,
270 size,
271 host_ptr,
272 events.size(),
273 events.get_event_ptr(),
274 &event_.get()
275 );
276
277 if(ret != CL_SUCCESS){
278 BOOST_THROW_EXCEPTION(opencl_error(ret));
279 }
280
281 return event_;
282 }
283
284 /// Enqueues a command to read data from \p buffer to host memory. The
285 /// 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