| 22 | namespace compute = boost::compute; |
| 23 | |
| 24 | BOOST_AUTO_TEST_CASE(sum_abs_int_doctest) |
| 25 | { |
| 26 | using boost::compute::abs; |
| 27 | using boost::compute::plus; |
| 28 | |
| 29 | int data[] = { 1, -2, -3, -4, 5 }; |
| 30 | compute::vector<int> vec(data, data + 5, queue); |
| 31 | |
| 32 | //! [sum_abs_int] |
| 33 | int sum = 0; |
| 34 | boost::compute::transform_reduce( |
| 35 | vec.begin(), vec.end(), &sum, abs<int>(), plus<int>(), queue |
| 36 | ); |
| 37 | //! [sum_abs_int] |
| 38 | |
| 39 | BOOST_CHECK_EQUAL(sum, 15); |
| 40 | } |
| 41 | |
| 42 | BOOST_AUTO_TEST_CASE(multiply_vector_length) |
| 43 | { |
nothing calls this directly
no test coverage detected