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

Function BOOST_AUTO_TEST_CASE

test/test_scan.cpp:34–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace bc = boost::compute;
33
34BOOST_AUTO_TEST_CASE(inclusive_scan_int)
35{
36 int data[] = { 1, 2, 1, 2, 3 };
37 bc::vector<int> vector(data, data + 5, queue);
38 BOOST_CHECK_EQUAL(vector.size(), size_t(5));
39
40 bc::vector<int> result(5, context);
41 BOOST_CHECK_EQUAL(result.size(), size_t(5));
42
43 // inclusive scan
44 bc::inclusive_scan(vector.begin(), vector.end(), result.begin(), queue);
45 CHECK_RANGE_EQUAL(int, 5, result, (1, 3, 4, 6, 9));
46
47 // in-place inclusive scan
48 CHECK_RANGE_EQUAL(int, 5, vector, (1, 2, 1, 2, 3));
49 bc::inclusive_scan(vector.begin(), vector.end(), vector.begin(), queue);
50 CHECK_RANGE_EQUAL(int, 5, vector, (1, 3, 4, 6, 9));
51}
52
53BOOST_AUTO_TEST_CASE(exclusive_scan_int)
54{

Callers

nothing calls this directly

Calls 10

inclusive_scanFunction · 0.85
exclusive_scanFunction · 0.85
make_counting_iteratorFunction · 0.85
make_transform_iteratorFunction · 0.85
copyFunction · 0.85
partial_sumFunction · 0.85
CHECK_RANGE_EQUALFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected