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

[FEA]: Have a less verbose pinned memory container #2485

Closed
1 task done
Kh4ster opened this issue Sep 30, 2024 · 2 comments · Fixed by #2653
Closed
1 task done

[FEA]: Have a less verbose pinned memory container #2485

Kh4ster opened this issue Sep 30, 2024 · 2 comments · Fixed by #2653
Assignees
Labels
feature request New feature or request.

Comments

@Kh4ster
Copy link
Contributor

Kh4ster commented Sep 30, 2024

Is this a duplicate?

Area

Thrust

Is your feature request related to a problem? Please describe.

Currently, the least verbose way for users to have a container of pinned memory without having to write any custom code is this:

thrust::host_vector<i_t, thrust::mr::stateless_resource_allocator<i_t, thrust::system::cuda::universal_host_pinned_memory_resource>>

See slack discussion here: https://nvidia.slack.com/archives/CCP05T27R/p1723208979166279

Describe the solution you'd like

I think there should be something less verbose like:

thrust::host_vector<i_t, thrust::host_pinned> or thrust::pinned_host_vector<i_t>

Describe alternatives you've considered

Hande written allocator but users shouldn't have to do that.
Libcudf pinned host vector: rapidsai/cudf#16206 rapidsai/cudf#15895 which should be generally available in CCCL.

Additional context

No response

@Kh4ster Kh4ster added the feature request New feature or request. label Sep 30, 2024
@github-project-automation github-project-automation bot moved this to Todo in CCCL Sep 30, 2024
@bernhardmgruber
Copy link
Contributor

There is ongoing work on providing a better replacement for Thrust's vectors that will support pinned memory. @miscco knows more about this.

In the meantime, as a very simple fix, we could just add the following to thrust:

namespace thrust {
  template <typename T>
  using host_pinned_vector = host_vector<T, mr::stateless_resource_allocator<T, system::cuda::universal_host_pinned_memory_resource>>;
}

@bernhardmgruber bernhardmgruber self-assigned this Oct 28, 2024
@bernhardmgruber
Copy link
Contributor

Some pieces were already present in thrust, like universal_host_pinned_memory_resource. The unit tests were also already covering a host pinned vector.

Following existing naming conventions, the new facility will probably be called thrust::universal_host_pinned_vector<T>.

bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Oct 29, 2024
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Oct 29, 2024
bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Oct 30, 2024
bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Oct 30, 2024
bernhardmgruber added a commit to bernhardmgruber/cccl that referenced this issue Oct 30, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Oct 30, 2024
fbusato pushed a commit to fbusato/cccl that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants