At the moment (on the development branch), when one wants to copy from or to a standard library container with contiguous storage, e.g. a vector, one has to use the .data() method (or .begin() iterator), and actually copy to a pointer. This is both a bit verbose, and sometimes requires that one also specify the size as an argument, which is slightly more error prone. It would be nice if we could say:
std::vector<float> v = get_my_vector();
auto d_sp = cuda::memory::make_unique_span<float>(device, v.size());
cuda::memory::copy(d_sp, v_host);
At the moment (on the development branch), when one wants to copy from or to a standard library container with contiguous storage, e.g. a vector, one has to use the
.data()
method (or.begin()
iterator), and actually copy to a pointer. This is both a bit verbose, and sometimes requires that one also specify the size as an argument, which is slightly more error prone. It would be nice if we could say: