| 27 | namespace compute = boost::compute; |
| 28 | |
| 29 | BOOST_AUTO_TEST_CASE(add_two) |
| 30 | { |
| 31 | int two = 2; |
| 32 | BOOST_COMPUTE_CLOSURE(int, add_two, (int x), (two), |
| 33 | { |
| 34 | return x + two; |
| 35 | }); |
| 36 | |
| 37 | int data[] = { 1, 2, 3, 4 }; |
| 38 | compute::vector<int> vector(data, data + 4, queue); |
| 39 | |
| 40 | compute::transform( |
| 41 | vector.begin(), vector.end(), vector.begin(), add_two, queue |
| 42 | ); |
| 43 | CHECK_RANGE_EQUAL(int, 4, vector, (3, 4, 5, 6)); |
| 44 | } |
| 45 | |
| 46 | BOOST_AUTO_TEST_CASE(add_two_and_pi) |
| 47 | { |
nothing calls this directly
no test coverage detected