]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/test/test_clamp_range.cpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
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
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #define BOOST_TEST_MODULE TestClampRange
12 #include <boost/test/unit_test.hpp>
14 #include <boost/compute/system.hpp>
15 #include <boost/compute/container/vector.hpp>
16 #include <boost/compute/experimental/clamp_range.hpp>
18 #include "check_macros.hpp"
19 #include "context_setup.hpp"
21 namespace compute
= boost::compute
;
23 BOOST_AUTO_TEST_CASE(clamp_float_range
)
25 float data
[] = { 1.f
, 2.f
, 3.f
, 4.f
, 5.f
, 6.f
, 7.f
, 8.f
};
26 compute::vector
<float> input(data
, data
+ 8, queue
);
28 compute::vector
<float> result(8, context
);
29 compute::experimental::clamp_range(
39 (3.f
, 3.f
, 3.f
, 4.f
, 5.f
, 6.f
, 6.f
, 6.f
)
43 BOOST_AUTO_TEST_SUITE_END()