2
0
mirror of https://github.com/boostorg/compute.git synced 2026-02-19 02:12:19 +00:00

Fix issue with copy() and std::vector<bool>

This commit is contained in:
Kyle Lutz
2014-11-26 08:42:48 -08:00
parent 1e0505d79c
commit a6bdf21b31
2 changed files with 27 additions and 0 deletions

View File

@@ -292,4 +292,18 @@ BOOST_AUTO_TEST_CASE(copy_svm_ptr)
}
#endif // CL_VERSION_2_0
BOOST_AUTO_TEST_CASE(copy_to_vector_bool)
{
using compute::uchar_;
compute::vector<uchar_> vec;
vec.push_back(true, queue);
vec.push_back(false, queue);
std::vector<bool> host_vec(vec.size());
compute::copy(vec.begin(), vec.end(), host_vec.begin(), queue);
BOOST_CHECK(host_vec[0] == true);
BOOST_CHECK(host_vec[1] == false);
}
BOOST_AUTO_TEST_SUITE_END()