MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

compute/test/test_copy.cpp:41–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace compute = boost::compute;
40
41BOOST_AUTO_TEST_CASE(copy_on_device)
42{
43 float data[] = { 6.1f, 10.2f, 19.3f, 25.4f };
44 bc::vector<float> a(4, context);
45 bc::copy(data, data + 4, a.begin(), queue);
46 CHECK_RANGE_EQUAL(float, 4, a, (6.1f, 10.2f, 19.3f, 25.4f));
47
48 bc::vector<float> b(4, context);
49 bc::fill(b.begin(), b.end(), 0, queue);
50 CHECK_RANGE_EQUAL(float, 4, b, (0.0f, 0.0f, 0.0f, 0.0f));
51
52 bc::copy(a.begin(), a.end(), b.begin(), queue);
53 CHECK_RANGE_EQUAL(float, 4, b, (6.1f, 10.2f, 19.3f, 25.4f));
54
55 bc::vector<float> c(context);
56 bc::copy(c.begin(), c.end(), b.begin(), queue);
57 CHECK_RANGE_EQUAL(float, 4, b, (6.1f, 10.2f, 19.3f, 25.4f));
58}
59
60BOOST_AUTO_TEST_CASE(copy_on_device_device_ptr)
61{

Callers

nothing calls this directly

Calls 15

copyFunction · 0.85
copy_asyncFunction · 0.85
copy_nFunction · 0.85
iotaFunction · 0.85
bug_in_svmmemcpyFunction · 0.85
svm_freeFunction · 0.85
get_command_typeMethod · 0.80
CHECK_RANGE_EQUALFunction · 0.70
fillFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected