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

Function BOOST_AUTO_TEST_CASE

test/test_set_intersection.cpp:24–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace bc = boost::compute;
23
24BOOST_AUTO_TEST_CASE(set_intersection_int)
25{
26 int dataset1[] = {1, 1, 2, 2, 2, 2, 3, 3, 4, 5, 6, 10};
27 bc::vector<bc::int_> set1(dataset1, dataset1 + 12, queue);
28
29 int dataset2[] = {0, 2, 2, 4, 5, 6, 8, 8, 9, 9, 9, 13};
30 bc::vector<bc::int_> set2(dataset2, dataset2 + 12, queue);
31
32 bc::vector<bc::uint_>result(10, queue.get_context());
33
34 bc::vector<bc::uint_>::iterator iter =
35 bc::set_intersection(set1.begin(), set1.begin() + 12,
36 set2.begin(), set2.begin() + 12,
37 result.begin(), queue);
38
39 CHECK_RANGE_EQUAL(int, 5, result, (2, 2, 4, 5, 6));
40 BOOST_VERIFY(iter == result.begin()+5);
41}
42
43BOOST_AUTO_TEST_CASE(set_intersection_string)
44{

Callers

nothing calls this directly

Calls 3

set_intersectionFunction · 0.85
get_contextMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected