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

Function ensure_std_accumulate_equality

test/test_accumulate.cpp:259–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258template<class T>
259void ensure_std_accumulate_equality(const std::vector<T> &data,
260 boost::compute::command_queue &queue)
261{
262 boost::compute::mapped_view<T> view(&data[0], data.size(), queue.get_context());
263
264 BOOST_CHECK_EQUAL(
265 std::accumulate(data.begin(), data.end(), 0),
266 boost::compute::accumulate(view.begin(), view.end(), 0, queue)
267 );
268}
269
270BOOST_AUTO_TEST_CASE(std_accumulate_equality)
271{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

accumulateFunction · 0.85
sizeMethod · 0.45
get_contextMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected