File indexing completed on 2025-01-18 09:29:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_ALGORITHM_IS_PARTITIONED_HPP
0012 #define BOOST_COMPUTE_ALGORITHM_IS_PARTITIONED_HPP
0013
0014 #include <boost/static_assert.hpp>
0015
0016 #include <boost/compute/system.hpp>
0017 #include <boost/compute/command_queue.hpp>
0018 #include <boost/compute/algorithm/find_if.hpp>
0019 #include <boost/compute/algorithm/find_if_not.hpp>
0020 #include <boost/compute/type_traits/is_device_iterator.hpp>
0021
0022 namespace boost {
0023 namespace compute {
0024
0025
0026
0027
0028
0029 template<class InputIterator, class UnaryPredicate>
0030 inline bool is_partitioned(InputIterator first,
0031 InputIterator last,
0032 UnaryPredicate predicate,
0033 command_queue &queue = system::default_queue())
0034 {
0035 BOOST_STATIC_ASSERT(is_device_iterator<InputIterator>::value);
0036 return ::boost::compute::find_if(
0037 ::boost::compute::find_if_not(first,
0038 last,
0039 predicate,
0040 queue),
0041 last,
0042 predicate,
0043 queue) == last;
0044 }
0045
0046 }
0047 }
0048
0049 #endif