]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/compute/test/test_for_each.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / compute / test / test_for_each.cpp
CommitLineData
7c673cae
FG
1//---------------------------------------------------------------------------//
2// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@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 TestForEach
12#include <boost/test/unit_test.hpp>
13
14#include <boost/compute/function.hpp>
15#include <boost/compute/algorithm/iota.hpp>
16#include <boost/compute/algorithm/for_each.hpp>
17#include <boost/compute/algorithm/for_each_n.hpp>
18#include <boost/compute/container/vector.hpp>
19
20#include "context_setup.hpp"
21
22namespace bc = boost::compute;
23
24BOOST_AUTO_TEST_CASE(for_each_nop)
25{
26 bc::vector<int> vector(4, context);
27 bc::iota(vector.begin(), vector.end(), 0, queue);
28
29 BOOST_COMPUTE_FUNCTION(void, nop, (int ignored), {});
30
31 bc::for_each(vector.begin(), vector.end(), nop, queue);
b32b8144 32 queue.finish();
7c673cae
FG
33}
34
35BOOST_AUTO_TEST_CASE(for_each_n_nop)
36{
37 bc::vector<int> vector(4, context);
38 bc::iota(vector.begin(), vector.end(), 0, queue);
39
40 BOOST_COMPUTE_FUNCTION(void, nop, (int ignored), {});
41
42 bc::for_each_n(vector.begin(), vector.size(), nop, queue);
b32b8144 43 queue.finish();
7c673cae
FG
44}
45
46BOOST_AUTO_TEST_SUITE_END()