Skip to content

Support copying from standard-library containers with contiguous storage #606

@eyalroz

Description

@eyalroz

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);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions