Back to home page

EIC code displayed by LXR

 
 

    


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

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_DETAIL_SCAN_HPP
0012 #define BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP
0013 
0014 #include <boost/compute/device.hpp>
0015 #include <boost/compute/algorithm/detail/scan_on_cpu.hpp>
0016 #include <boost/compute/algorithm/detail/scan_on_gpu.hpp>
0017 
0018 namespace boost {
0019 namespace compute {
0020 namespace detail {
0021 
0022 template<class InputIterator, class OutputIterator, class T, class BinaryOperator>
0023 inline OutputIterator scan(InputIterator first,
0024                            InputIterator last,
0025                            OutputIterator result,
0026                            bool exclusive,
0027                            T init,
0028                            BinaryOperator op,
0029                            command_queue &queue)
0030 {
0031     const device &device = queue.get_device();
0032 
0033     if(device.type() & device::cpu){
0034         return scan_on_cpu(first, last, result, exclusive, init, op, queue);
0035     }
0036     else {
0037         return scan_on_gpu(first, last, result, exclusive, init, op, queue);
0038     }
0039 }
0040 
0041 } // end detail namespace
0042 } // end compute namespace
0043 } // end boost namespace
0044 
0045 #endif // BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP