summaryrefslogtreecommitdiff
path: root/boost/compute/algorithm/for_each_n.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/compute/algorithm/for_each_n.hpp')
-rw-r--r--boost/compute/algorithm/for_each_n.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/boost/compute/algorithm/for_each_n.hpp b/boost/compute/algorithm/for_each_n.hpp
index 77932ab209..4fd981d952 100644
--- a/boost/compute/algorithm/for_each_n.hpp
+++ b/boost/compute/algorithm/for_each_n.hpp
@@ -11,7 +11,10 @@
#ifndef BOOST_COMPUTE_ALGORITHM_FOR_EACH_N_HPP
#define BOOST_COMPUTE_ALGORITHM_FOR_EACH_N_HPP
+#include <boost/static_assert.hpp>
+
#include <boost/compute/algorithm/for_each.hpp>
+#include <boost/compute/type_traits/is_device_iterator.hpp>
namespace boost {
namespace compute {
@@ -28,6 +31,7 @@ inline UnaryFunction for_each_n(InputIterator first,
UnaryFunction function,
command_queue &queue = system::default_queue())
{
+ BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
return ::boost::compute::for_each(first, first + count, function, queue);
}