Skip to main content

Module memory

Module memory 

Source
Expand description

Runtime-API device memory.

Modules§

pinned_flags
Flags for cudaHostAlloc. See baracuda_cuda_sys::runtime::types::cudaHostAllocFlags for raw values.

Structs§

DeviceBuffer
Owned, typed allocation of device memory (Runtime API).
ManagedBuffer
Unified managed-memory buffer — allocated via cudaMallocManaged. Accessible from both host and device without explicit copies.
PinnedHostBuffer
Pinned (page-locked) host allocation — CUDA-owned memory that supports real async H↔D copies without staging.
PinnedRegistration
RAII guard for cudaHostRegister — pins an existing host slice and unregisters on drop.

Enums§

PrefetchTarget
Target for mem_prefetch_async / mem_advise. The CUDA Runtime API’s v1 variants take an ordinal — pass cudaCpuDeviceId (-1) for host.

Functions§

mem_advise
cudaMemAdvise — unified-memory placement hint. advice is a constant from baracuda_cuda_sys::runtime::types::cudaMemoryAdvise.
mem_get_info
cudaMemGetInfo(free, total) bytes on the current device.
mem_prefetch_async
Prefetch count bytes of unified memory at dev_ptr to target, ordered on stream. dev_ptr must be a managed-memory allocation (from ManagedBuffer or cudaMallocManaged).
memcpy_peer
Peer-to-peer device memory copy. Both buffers must be on enabled-peer devices (see crate::Device::enable_peer_access).
memcpy_peer_async
Async peer-to-peer memcpy ordered on stream.