| 25 | #include "context_setup.hpp" |
| 26 | |
| 27 | BOOST_AUTO_TEST_CASE(generate_42_doctest) |
| 28 | { |
| 29 | boost::compute::vector<int> result(4, context); |
| 30 | |
| 31 | //! [generate_42] |
| 32 | BOOST_COMPUTE_FUNCTION(int, ret42, (), |
| 33 | { |
| 34 | return 42; |
| 35 | }); |
| 36 | |
| 37 | boost::compute::copy( |
| 38 | boost::compute::make_function_input_iterator(ret42, 0), |
| 39 | boost::compute::make_function_input_iterator(ret42, result.size()), |
| 40 | result.begin(), |
| 41 | queue |
| 42 | ); |
| 43 | |
| 44 | // result == { 42, 42, 42, 42 } |
| 45 | //! [generate_42] |
| 46 | |
| 47 | CHECK_RANGE_EQUAL(int, 4, result, (42, 42, 42, 42)); |
| 48 | } |
| 49 | |
| 50 | BOOST_AUTO_TEST_SUITE_END() |
nothing calls this directly
no outgoing calls
no test coverage detected