| 22 | #include "context_setup.hpp" |
| 23 | |
| 24 | BOOST_AUTO_TEST_CASE(normal_distribution_doctest) |
| 25 | { |
| 26 | using boost::compute::lambda::_1; |
| 27 | |
| 28 | boost::compute::vector<float> vec(10, context); |
| 29 | |
| 30 | //! [generate] |
| 31 | // initialize the default random engine |
| 32 | boost::compute::default_random_engine engine(queue); |
| 33 | |
| 34 | // setup the normal distribution to produce floats centered at 5 |
| 35 | boost::compute::normal_distribution<float> distribution(5.0f, 1.0f); |
| 36 | |
| 37 | // generate the random values and store them to 'vec' |
| 38 | distribution.generate(vec.begin(), vec.end(), engine, queue); |
| 39 | //! [generate] |
| 40 | } |
| 41 | |
| 42 | BOOST_AUTO_TEST_SUITE_END() |