Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eyalroz opened this issue Mar 10, 2024 · 0 comments
Closed

Comments

@eyalroz
Copy link
Owner

eyalroz commented Mar 10, 2024

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);
eyalroz added a commit that referenced this issue Mar 10, 2024
eyalroz added a commit that referenced this issue Mar 10, 2024
eyalroz added a commit that referenced this issue Mar 11, 2024
eyalroz added a commit that referenced this issue Mar 11, 2024
eyalroz added a commit that referenced this issue Mar 11, 2024
eyalroz added a commit that referenced this issue Mar 11, 2024
eyalroz added a commit that referenced this issue Mar 11, 2024
eyalroz added a commit that referenced this issue Mar 18, 2024
eyalroz added a commit that referenced this issue Mar 29, 2024
eyalroz added a commit that referenced this issue Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant