]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/test/test_partition_point.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / compute / test / test_partition_point.cpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2014 Roshan <thisisroshansmail@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10
11 #define BOOST_TEST_MODULE TestPartitionPoint
12 #include <boost/test/unit_test.hpp>
13
14 #include <boost/compute/algorithm/partition_point.hpp>
15 #include <boost/compute/command_queue.hpp>
16 #include <boost/compute/container/vector.hpp>
17 #include <boost/compute/functional.hpp>
18 #include <boost/compute/lambda.hpp>
19 #include <boost/compute/system.hpp>
20
21 #include "check_macros.hpp"
22 #include "context_setup.hpp"
23
24 namespace bc = boost::compute;
25
26 BOOST_AUTO_TEST_CASE(partition_point_int)
27 {
28 int dataset[] = {1, 1, 5, 2, 4, -2, 0, -1, 0, -1};
29 bc::vector<bc::int_> vector(dataset, dataset + 10, queue);
30
31 bc::vector<bc::int_>::iterator iter =
32 bc::partition_point(vector.begin(), vector.begin() + 10,
33 bc::_1 > 0, queue);
34
35 BOOST_VERIFY(iter == vector.begin()+5);
36 }
37
38 BOOST_AUTO_TEST_SUITE_END()