]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/compute/algorithm/accumulate.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / compute / algorithm / accumulate.hpp
index be20bee60eb4db7fe4bf05fdf40d5174462f66b6..025b0a9c8a5eff80978498dfe230c261cb555e7f 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef BOOST_COMPUTE_ALGORITHM_ACCUMULATE_HPP
 #define BOOST_COMPUTE_ALGORITHM_ACCUMULATE_HPP
 
+#include <boost/static_assert.hpp>
 #include <boost/preprocessor/seq/for_each.hpp>
 
 #include <boost/compute/system.hpp>
@@ -20,6 +21,7 @@
 #include <boost/compute/algorithm/detail/serial_accumulate.hpp>
 #include <boost/compute/container/array.hpp>
 #include <boost/compute/container/vector.hpp>
+#include <boost/compute/type_traits/is_device_iterator.hpp>
 #include <boost/compute/detail/iterator_range_size.hpp>
 
 namespace boost {
@@ -167,6 +169,8 @@ inline T accumulate(InputIterator first,
                     BinaryFunction function,
                     command_queue &queue = system::default_queue())
 {
+    BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
+
     return detail::dispatch_accumulate(first, last, init, function, queue);
 }
 
@@ -177,6 +181,7 @@ inline T accumulate(InputIterator first,
                     T init,
                     command_queue &queue = system::default_queue())
 {
+    BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
     typedef typename std::iterator_traits<InputIterator>::value_type IT;
 
     return detail::dispatch_accumulate(first, last, init, plus<IT>(), queue);