| 22 | namespace compute = boost::compute; |
| 23 | |
| 24 | BOOST_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 | |
| 39 | BOOST_AUTO_TEST_CASE(copy_index_then_gather) |
| 40 | { |
nothing calls this directly
no test coverage detected