]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/compute/test/test_threefry_engine.cpp
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Muhammad Junaid Muzammil <mjunaidmuzammil@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://kylelutz.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #define BOOST_TEST_MODULE TestThreefry
12 #include <boost/test/unit_test.hpp>
14 #include <boost/compute/random/threefry_engine.hpp>
15 #include <boost/compute/container/vector.hpp>
17 #include "check_macros.hpp"
18 #include "context_setup.hpp"
20 BOOST_AUTO_TEST_CASE(generate_uint
)
23 using boost::compute::uint_
;
25 boost::compute::threefry_engine
<> rng(queue
);
27 boost::compute::vector
<uint_
> vector_ctr(20, context
);
30 for(int i
= 0; i
< 10; i
++) {
35 boost::compute::copy(ctr
, ctr
+20, vector_ctr
.begin(), queue
);
37 rng
.generate(vector_ctr
.begin(), vector_ctr
.end(), queue
);
39 uint_
, 20, vector_ctr
,
63 BOOST_AUTO_TEST_SUITE_END()