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

Function dispatch_fill_async

include/boost/compute/algorithm/fill.hpp:149–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148template<class BufferIterator, class T>
149inline future<void>
150dispatch_fill_async(BufferIterator first,
151 size_t count,
152 const T &value,
153 command_queue &queue,
154 typename boost::enable_if<
155 is_valid_fill_buffer_iterator<BufferIterator>
156 >::type* = 0)
157{
158 typedef typename std::iterator_traits<BufferIterator>::value_type value_type;
159
160 // check if the device supports OpenCL 1.2 (required for enqueue_fill_buffer)
161 if(!queue.check_device_version(1, 2)){
162 return fill_async_with_copy(first, count, value, queue);
163 }
164
165 value_type pattern = static_cast<value_type>(value);
166 size_t offset = static_cast<size_t>(first.get_index());
167
168 event event_ =
169 queue.enqueue_fill_buffer(first.get_buffer(),
170 &pattern,
171 sizeof(value_type),
172 offset * sizeof(value_type),
173 count * sizeof(value_type));
174
175 return future<void>(event_);
176}
177
178#ifdef BOOST_COMPUTE_CL_VERSION_2_0
179// specializations for svm_ptr<T>

Callers 1

fill_asyncFunction · 0.85

Calls 6

fill_async_with_copyFunction · 0.85
check_device_versionMethod · 0.80
enqueue_fill_bufferMethod · 0.80
enqueue_svm_fillMethod · 0.80
get_indexMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected