File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
include/boost/compute/algorithm Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 2828#include < boost/compute/iterator/discard_iterator.hpp>
2929#include < boost/compute/detail/is_buffer_iterator.hpp>
3030#include < boost/compute/detail/iterator_range_size.hpp>
31+ #include < boost/compute/type_traits/is_device_iterator.hpp>
32+
3133
3234namespace boost {
3335namespace compute {
@@ -281,6 +283,7 @@ inline void fill(BufferIterator first,
281283 const T &value,
282284 command_queue &queue = system::default_queue())
283285{
286+ BOOST_STATIC_ASSERT (is_device_iterator<BufferIterator>::value);
284287 size_t count = detail::iterator_range_size (first, last);
285288 if (count == 0 ){
286289 return ;
Original file line number Diff line number Diff line change 1111#ifndef BOOST_COMPUTE_ALGORITHM_FILL_N_HPP
1212#define BOOST_COMPUTE_ALGORITHM_FILL_N_HPP
1313
14+ #include < boost/static_assert.hpp>
15+
1416#include < boost/compute/system.hpp>
1517#include < boost/compute/command_queue.hpp>
1618#include < boost/compute/algorithm/fill.hpp>
19+ #include < boost/compute/type_traits/is_device_iterator.hpp>
1720
1821namespace boost {
1922namespace compute {
@@ -29,6 +32,7 @@ inline void fill_n(BufferIterator first,
2932 const T &value,
3033 command_queue &queue = system::default_queue())
3134{
35+ BOOST_STATIC_ASSERT (is_device_iterator<BufferIterator>::value);
3236 ::boost::compute::fill (first, first + count, value, queue);
3337}
3438
Original file line number Diff line number Diff line change 1111#ifndef BOOST_COMPUTE_ALGORITHM_IOTA_HPP
1212#define BOOST_COMPUTE_ALGORITHM_IOTA_HPP
1313
14+ #include < boost/static_assert.hpp>
15+
1416#include < boost/compute/system.hpp>
1517#include < boost/compute/command_queue.hpp>
1618#include < boost/compute/algorithm/copy.hpp>
1719#include < boost/compute/iterator/counting_iterator.hpp>
20+ #include < boost/compute/type_traits/is_device_iterator.hpp>
1821
1922namespace boost {
2023namespace compute {
@@ -34,6 +37,7 @@ inline void iota(BufferIterator first,
3437 const T &value,
3538 command_queue &queue = system::default_queue())
3639{
40+ BOOST_STATIC_ASSERT (is_device_iterator<BufferIterator>::value);
3741 T count = static_cast <T>(detail::iterator_range_size (first, last));
3842
3943 copy (
You can’t perform that action at this time.
0 commit comments