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

Function BOOST_AUTO_TEST_CASE

test/test_inplace_reduce.cpp:25–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include "context_setup.hpp"
24
25BOOST_AUTO_TEST_CASE(sum_int)
26{
27 if(is_apple_cpu_device(device)) {
28 std::cerr
29 << "skipping all inplace_reduce tests due to Apple platform"
30 << " behavior when local memory is used on a CPU device"
31 << std::endl;
32 return;
33 }
34
35 int data[] = { 1, 5, 3, 4, 9, 3, 5, 3 };
36 boost::compute::vector<int> vector(data, data + 8, queue);
37
38 boost::compute::detail::inplace_reduce(vector.begin(),
39 vector.end(),
40 boost::compute::plus<int>(),
41 queue);
42 queue.finish();
43 BOOST_CHECK_EQUAL(int(vector[0]), int(33));
44
45 vector.assign(data, data + 8);
46 vector.push_back(3);
47 boost::compute::detail::inplace_reduce(vector.begin(),
48 vector.end(),
49 boost::compute::plus<int>(),
50 queue);
51 queue.finish();
52 BOOST_CHECK_EQUAL(int(vector[0]), int(36));
53}
54
55BOOST_AUTO_TEST_CASE(multiply_int)
56{

Callers

nothing calls this directly

Calls 9

is_apple_cpu_deviceFunction · 0.85
inplace_reduceFunction · 0.85
iotaFunction · 0.85
assignMethod · 0.80
push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected