Skip to content

Make a few memory management objects public + Miscellaneous doc updates #693

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

leofang
Copy link
Member

@leofang leofang commented Jun 7, 2025

Description

closes #596.

  • Buffer and MemoryResource are already public (ex: returned by Device.memory_resource.allocate()). We just expose them under the cuda.core namespace for documentation purposes (Doc: Document cuda.core public (but non-entry-point) objects #601)
    • I noticed that Buffer's destructor would use the default stream if stream is not passed explicitly. This isn't right because it takes away the control from the memory resource authors. We now always let the memory resource make the call.
    • I noticed Buffer has an __init__(). This isn't right (since we want buffers to be returned by MR.allocate()) if we want to make it public. I moved this support to from_handle().
  • The new exposed objects DeviceMemoryResource and LegacyPinnedMemoryResource are named after their respective cccl-rt/cudax counterparts.
  • The __cuda_stream__ protocol has a protocol type now (IsStreamT)
  • Internal refactoring to consolidate support for objects that have __cuda_stream__
  • Documentation is clarified and expanded to reflect the new public exposure of these classes, in particular many type hints are updated/fixed
  • Update the docs to mention all other merged PRs targeting this release (v0.3.0)

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Copy link
Contributor

copy-pr-bot bot commented Jun 7, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang leofang added this to the cuda.core beta 4 milestone Jun 7, 2025
@leofang
Copy link
Member Author

leofang commented Jun 7, 2025

/ok to test a6387a0

@leofang leofang self-assigned this Jun 7, 2025
@leofang leofang added P1 Medium priority - Should do feature New feature or request cuda.core Everything related to the cuda.core module labels Jun 7, 2025
Copy link

github-actions bot commented Jun 7, 2025

@leofang leofang marked this pull request as draft June 7, 2025 04:22
@leofang
Copy link
Member Author

leofang commented Jun 9, 2025

/ok to test cc0f6ce

@leofang leofang added P0 High priority - Must do! and removed P1 Medium priority - Should do labels Jun 9, 2025
@leofang leofang changed the title Make a few memory management objects public Make a few memory management objects public + Miscellaneous doc updates Jun 9, 2025
@leofang leofang marked this pull request as ready for review June 9, 2025 01:48
@leofang leofang requested a review from rwgk June 9, 2025 01:49
@leofang leofang marked this pull request as draft June 9, 2025 02:22
@leofang leofang added the breaking Breaking changes are introduced label Jun 9, 2025
@leofang
Copy link
Member Author

leofang commented Jun 9, 2025

/ok to test 58323ac

@leofang leofang marked this pull request as ready for review June 9, 2025 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking changes are introduced cuda.core Everything related to the cuda.core module feature New feature or request P0 High priority - Must do!
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Expose pinned memory resource as public API
1 participant