2
0
mirror of https://github.com/boostorg/compute.git synced 2026-02-19 14:22:12 +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

@@ -51,6 +51,19 @@ inline HostIterator copy_to_host(DeviceIterator first,
return iterator_plus_distance(result, count);
}
// copy_to_host() specialization for std::vector<bool>
template<class DeviceIterator>
inline std::vector<bool>::iterator
copy_to_host(DeviceIterator first,
DeviceIterator last,
std::vector<bool>::iterator result,
command_queue &queue)
{
std::vector<uint8_t> temp(std::distance(first, last));
copy_to_host(first, last, temp.begin(), queue);
return std::copy(temp.begin(), temp.end(), result);
}
template<class DeviceIterator, class HostIterator>
inline future<HostIterator> copy_to_host_async(DeviceIterator first,
DeviceIterator last,