MCPcopy Create free account
hub / github.com/boostorg/compute / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

test/test_normal_distribution.cpp:24–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#include "context_setup.hpp"
23
24BOOST_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
32boost::compute::default_random_engine engine(queue);
33
34// setup the normal distribution to produce floats centered at 5
35boost::compute::normal_distribution<float> distribution(5.0f, 1.0f);
36
37// generate the random values and store them to 'vec'
38distribution.generate(vec.begin(), vec.end(), engine, queue);
39//! [generate]
40}
41
42BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 3

generateMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected