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

Function copy_to_host

include/boost/compute/algorithm/detail/copy_to_host.hpp:29–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<class DeviceIterator, class HostIterator>
29inline HostIterator copy_to_host(DeviceIterator first,
30 DeviceIterator last,
31 HostIterator result,
32 command_queue &queue,
33 const wait_list &events)
34{
35 typedef typename
36 std::iterator_traits<DeviceIterator>::value_type
37 value_type;
38
39 size_t count = iterator_range_size(first, last);
40 if(count == 0){
41 return result;
42 }
43
44 const buffer &buffer = first.get_buffer();
45 size_t offset = first.get_index();
46
47 queue.enqueue_read_buffer(buffer,
48 offset * sizeof(value_type),
49 count * sizeof(value_type),
50 ::boost::addressof(*result),
51 events);
52
53 return iterator_plus_distance(result, count);
54}
55
56template<class DeviceIterator, class HostIterator>
57inline HostIterator copy_to_host_map(DeviceIterator first,

Callers 1

dispatch_copyFunction · 0.85

Calls 6

iterator_range_sizeFunction · 0.85
iterator_plus_distanceFunction · 0.85
enqueue_read_bufferMethod · 0.80
enqueue_svm_memcpyMethod · 0.80
get_indexMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected