MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

compute/test/test_scatter_if.cpp:25–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace bc = boost::compute;
24
25BOOST_AUTO_TEST_CASE(scatter_if_int)
26{
27 int input_data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
28 bc::vector<int> input(input_data, input_data + 10, queue);
29
30 int map_data[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
31
32 bc::vector<int> map(map_data, map_data + 10, queue);
33
34 int stencil_data[] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
35
36 bc::vector<bc::uint_> stencil(stencil_data, stencil_data + 10, queue);
37
38 bc::vector<int> output(input.size(), -1, queue);
39
40 bc::scatter_if(input.begin(), input.end(),
41 map.begin(), stencil.begin(),
42 output.begin(),
43 queue);
44
45 CHECK_RANGE_EQUAL(int, 10, output, (9, -1, 7, -1, 5, -1, 3, -1, 1, -1) );
46}
47
48BOOST_AUTO_TEST_CASE(scatter_if_constant_indices)
49{

Callers

nothing calls this directly

Calls 4

scatter_ifFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected