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

Function BOOST_AUTO_TEST_CASE

compute/test/test_complex.cpp:24–44  ·  view source on GitHub ↗

copies a vector of complex 's on the host to the device

Source from the content-addressed store, hash-verified

22
23// copies a vector of complex<float>'s on the host to the device
24BOOST_AUTO_TEST_CASE(copy_complex_vector)
25{
26 std::vector<std::complex<float> > host_vector;
27 host_vector.push_back(std::complex<float>(1.0f, 2.0f));
28 host_vector.push_back(std::complex<float>(-2.0f, 1.0f));
29 host_vector.push_back(std::complex<float>(1.0f, -2.0f));
30 host_vector.push_back(std::complex<float>(-2.0f, -1.0f));
31
32 boost::compute::vector<std::complex<float> > device_vector(context);
33 boost::compute::copy(
34 host_vector.begin(),
35 host_vector.end(),
36 device_vector.begin(),
37 queue
38 );
39 queue.finish();
40 BOOST_CHECK_EQUAL(std::complex<float>(device_vector[0]), std::complex<float>(1.0f, 2.0f));
41 BOOST_CHECK_EQUAL(std::complex<float>(device_vector[1]), std::complex<float>(-2.0f, 1.0f));
42 BOOST_CHECK_EQUAL(std::complex<float>(device_vector[2]), std::complex<float>(1.0f, -2.0f));
43 BOOST_CHECK_EQUAL(std::complex<float>(device_vector[3]), std::complex<float>(-2.0f, -1.0f));
44}
45
46// fills a vector of complex<float>'s on the device with a constant value
47BOOST_AUTO_TEST_CASE(fill_complex_vector)

Callers

nothing calls this directly

Calls 8

copyFunction · 0.85
transformFunction · 0.85
push_backMethod · 0.80
fillFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
finishMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected