| 23 | namespace compute = boost::compute; |
| 24 | |
| 25 | BOOST_AUTO_TEST_CASE(convert_int_float) |
| 26 | { |
| 27 | int data[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 28 | compute::vector<int> input(8, context); |
| 29 | compute::copy_n(data, 8, input.begin(), queue); |
| 30 | |
| 31 | compute::vector<float> output(8, context); |
| 32 | compute::transform( |
| 33 | input.begin(), |
| 34 | input.end(), |
| 35 | output.begin(), |
| 36 | compute::convert<float>(), |
| 37 | queue |
| 38 | ); |
| 39 | CHECK_RANGE_EQUAL( |
| 40 | float, 8, output, (1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f) |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | BOOST_AUTO_TEST_SUITE_END() |