Skip to content

Restore async DeviceBuffer compatibility methods #203

Closed

Description

@niklebedenko

Problem

DeviceBuffer<T> exposes stream-ordered allocation, copy, memset, and free behavior internally, but several compatibility methods that name those operations explicitly are missing from the public API. Code expecting uninitialized_async, copy_from_host_async, copy_from_device_async, zero_async, or drop_async cannot build even though the lower-level operations already exist.

Why this matters

The rest of the cuda-core buffer API makes stream ordering explicit. Named async compatibility methods let callers express stream-ordered ownership and copy lifetimes directly without dropping down to raw pointers or duplicating allocation/copy wrappers outside the crate.

Expected behavior

DeviceBuffer<T> should provide stream-ordered compatibility methods for uninitialized allocation, host-to-device copy, device-to-device copy, byte zeroing, and explicit async free. Zero-length buffers should remain valid no-ops for these methods.

Acceptance criteria

  • A compile regression using the missing async compatibility methods fails on upstream/main.
  • The same regression builds and passes on the patched branch.
  • Length mismatches still panic before copying.
  • Zero-length buffers avoid CUDA allocation/copy/free calls and can be dropped through the async path.
  • The implementation reuses the existing cuda-core memory helpers rather than adding a parallel driver binding path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions