| 39 | namespace compute = boost::compute; |
| 40 | |
| 41 | BOOST_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 | |
| 60 | BOOST_AUTO_TEST_CASE(copy_on_device_device_ptr) |
| 61 | { |
nothing calls this directly
no test coverage detected