| 23 | namespace bc = boost::compute; |
| 24 | |
| 25 | BOOST_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 | |
| 48 | BOOST_AUTO_TEST_CASE(scatter_if_constant_indices) |
| 49 | { |
nothing calls this directly
no test coverage detected