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

Function BOOST_AUTO_TEST_CASE

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

Source from the content-addressed store, hash-verified

22namespace compute = boost::compute;
23
24BOOST_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]
33int sum = 0;
34boost::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
42BOOST_AUTO_TEST_CASE(multiply_vector_length)
43{

Callers

nothing calls this directly

Calls 5

transform_reduceFunction · 0.85
reduceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected