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

Function BOOST_AUTO_TEST_CASE

test/test_closure.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27namespace compute = boost::compute;
28
29BOOST_AUTO_TEST_CASE(add_two)
30{
31 int two = 2;
32 BOOST_COMPUTE_CLOSURE(int, add_two, (int x), (two),
33 {
34 return x + two;
35 });
36
37 int data[] = { 1, 2, 3, 4 };
38 compute::vector<int> vector(data, data + 4, queue);
39
40 compute::transform(
41 vector.begin(), vector.end(), vector.begin(), add_two, queue
42 );
43 CHECK_RANGE_EQUAL(int, 4, vector, (3, 4, 5, 6));
44}
45
46BOOST_AUTO_TEST_CASE(add_two_and_pi)
47{

Callers

nothing calls this directly

Calls 11

transformFunction · 0.85
copyFunction · 0.85
make_counting_iteratorFunction · 0.85
fillFunction · 0.85
transform_reduceFunction · 0.85
assignMethod · 0.80
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected