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

Function BOOST_AUTO_TEST_CASE

test/test_gather.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace compute = boost::compute;
23
24BOOST_AUTO_TEST_CASE(gather_int)
25{
26 int input_data[] = { 1, 2, 3, 4, 5 };
27 compute::vector<int> input(input_data, input_data + 5, queue);
28
29 int indices_data[] = { 0, 4, 1, 3, 2 };
30 compute::vector<int> indices(indices_data, indices_data + 5, queue);
31
32 compute::vector<int> output(5, context);
33 compute::gather(
34 indices.begin(), indices.end(), input.begin(), output.begin(), queue
35 );
36 CHECK_RANGE_EQUAL(int, 5, output, (1, 5, 2, 4, 3));
37}
38
39BOOST_AUTO_TEST_CASE(copy_index_then_gather)
40{

Callers

nothing calls this directly

Calls 4

gatherFunction · 0.85
copy_index_ifFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected