summaryrefslogtreecommitdiff
path: root/boost/compute/algorithm/gather.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/compute/algorithm/gather.hpp')
-rw-r--r--boost/compute/algorithm/gather.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/boost/compute/algorithm/gather.hpp b/boost/compute/algorithm/gather.hpp
index 62442587f7..9d217837c3 100644
--- a/boost/compute/algorithm/gather.hpp
+++ b/boost/compute/algorithm/gather.hpp
@@ -11,6 +11,8 @@
#ifndef BOOST_COMPUTE_ALGORITHM_GATHER_HPP
#define BOOST_COMPUTE_ALGORITHM_GATHER_HPP
+#include <boost/static_assert.hpp>
+
#include <boost/compute/command_queue.hpp>
#include <boost/compute/detail/iterator_range_size.hpp>
#include <boost/compute/detail/meta_kernel.hpp>
@@ -18,6 +20,7 @@
#include <boost/compute/iterator/buffer_iterator.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/type_traits/type_name.hpp>
+#include <boost/compute/type_traits/is_device_iterator.hpp>
namespace boost {
namespace compute {
@@ -72,6 +75,10 @@ inline void gather(MapIterator first,
OutputIterator result,
command_queue &queue = system::default_queue())
{
+ BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
+ BOOST_STATIC_ASSERT(is_device_iterator<MapIterator>::value);
+ BOOST_STATIC_ASSERT(is_device_iterator<OutputIterator>::value);
+
detail::gather_kernel<InputIterator, MapIterator, OutputIterator> kernel;
kernel.set_range(first, last, input, result);