MCPcopy Create free account
hub / github.com/boostorg/compute / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/test_threefry_engine.cpp:20–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include "context_setup.hpp"
19
20BOOST_AUTO_TEST_CASE(generate_uint)
21{
22
23 using boost::compute::uint_;
24
25 boost::compute::threefry_engine<> rng(queue);
26
27 boost::compute::vector<uint_> vector_ctr(20, context);
28
29 uint32_t ctr[20];
30 for(int i = 0; i < 10; i++) {
31 ctr[i*2] = i;
32 ctr[i*2+1] = 0;
33 }
34
35 boost::compute::copy(ctr, ctr+20, vector_ctr.begin(), queue);
36
37 rng.generate(vector_ctr.begin(), vector_ctr.end(), queue);
38 CHECK_RANGE_EQUAL(
39 uint_, 20, vector_ctr,
40 (uint_(0x6b200159),
41 uint_(0x99ba4efe),
42 uint_(0x508efb2c),
43 uint_(0xc0de3f32),
44 uint_(0x64a626ec),
45 uint_(0xfc15e573),
46 uint_(0xb8abc4d1),
47 uint_(0x537eb86),
48 uint_(0xac6dc2bb),
49 uint_(0xa7adb3c3),
50 uint_(0x5641e094),
51 uint_(0xe4ab4fd),
52 uint_(0xa53c1ce9),
53 uint_(0xabcf1dba),
54 uint_(0x2677a25a),
55 uint_(0x76cf5efc),
56 uint_(0x2d08247f),
57 uint_(0x815480f1),
58 uint_(0x2d1fa53a),
59 uint_(0xdfe8514c))
60 );
61}
62
63BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 5

copyFunction · 0.85
CHECK_RANGE_EQUALFunction · 0.70
beginMethod · 0.45
generateMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected