Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:57

0001 //---------------------------------------------------------------------------//
0002 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 // See http://boostorg.github.com/compute for more information.
0009 //---------------------------------------------------------------------------//
0010 
0011 #ifndef BOOST_COMPUTE_ALGORITHM_NONE_OF_HPP
0012 #define BOOST_COMPUTE_ALGORITHM_NONE_OF_HPP
0013 
0014 #include <boost/static_assert.hpp>
0015 
0016 #include <boost/compute/system.hpp>
0017 #include <boost/compute/algorithm/find_if.hpp>
0018 #include <boost/compute/type_traits/is_device_iterator.hpp>
0019 
0020 namespace boost {
0021 namespace compute {
0022 
0023 /// Returns \c true if \p predicate returns \c true for none of the elements in
0024 /// the range [\p first, \p last).
0025 ///
0026 /// Space complexity: \Omega(1)
0027 ///
0028 /// \see all_of(), any_of()
0029 template<class InputIterator, class UnaryPredicate>
0030 inline bool none_of(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(first, last, predicate, queue) == last;
0037 }
0038 
0039 } // end compute namespace
0040 } // end boost namespace
0041 
0042 #endif // BOOST_COMPUTE_ALGORITHM_NONE_OF_HPP