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

Function dispatch_fill_async

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

Source from the content-addressed store, hash-verified

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