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

Function BOOST_AUTO_TEST_CASE

test/test_functional_unpack.cpp:26–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace compute = boost::compute;
25
26BOOST_AUTO_TEST_CASE(plus_int)
27{
28 int data1[] = { 1, 3, 5, 7 };
29 int data2[] = { 2, 4, 6, 8 };
30
31 compute::vector<int> input1(4, context);
32 compute::vector<int> input2(4, context);
33
34 compute::copy_n(data1, 4, input1.begin(), queue);
35 compute::copy_n(data2, 4, input2.begin(), queue);
36
37 compute::vector<int> output(4, context);
38 compute::transform(
39 compute::make_zip_iterator(
40 boost::make_tuple(input1.begin(), input2.begin())
41 ),
42 compute::make_zip_iterator(
43 boost::make_tuple(input1.end(), input2.end())
44 ),
45 output.begin(),
46 compute::detail::unpack(compute::plus<int>()),
47 queue
48 );
49 CHECK_RANGE_EQUAL(int, 4, output, (3, 7, 11, 15));
50}
51
52BOOST_AUTO_TEST_CASE(fma_float)
53{

Callers

nothing calls this directly

Calls 6

copy_nFunction · 0.85
transformFunction · 0.85
make_zip_iteratorFunction · 0.85
unpackFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected