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

Function accumulate_statistics

test/test_normal_distribution.cpp:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29template<class Stats, class T>
30boost::accumulators::accumulator_set<T, Stats>
31accumulate_statistics(const boost::compute::vector<T>& vector,
32 boost::compute::command_queue& queue) {
33 // copy vector to the host
34 std::vector<T> host_vector(vector.size());
35 boost::compute::copy(
36 vector.begin(), vector.end(), host_vector.begin(), queue
37 );
38
39 // compute desired statistics and return accumulator object
40 return std::for_each(
41 host_vector.begin(),
42 host_vector.end(),
43 boost::accumulators::accumulator_set<T, Stats>()
44 );
45}
46
47BOOST_AUTO_TEST_CASE(normal_distribution_doctest)
48{

Callers

nothing calls this directly

Calls 5

copyFunction · 0.85
for_eachFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected