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

Function BOOST_AUTO_TEST_CASE

test/test_functional_convert.cpp:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace compute = boost::compute;
24
25BOOST_AUTO_TEST_CASE(convert_int_float)
26{
27 int data[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
28 compute::vector<int> input(8, context);
29 compute::copy_n(data, 8, input.begin(), queue);
30
31 compute::vector<float> output(8, context);
32 compute::transform(
33 input.begin(),
34 input.end(),
35 output.begin(),
36 compute::convert<float>(),
37 queue
38 );
39 CHECK_RANGE_EQUAL(
40 float, 8, output, (1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f)
41 );
42}
43
44BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 4

copy_nFunction · 0.85
transformFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected