Skip to main content

atomr_accel_cuda/host/
mod.rs

1//! Host-side support: pinned (page-locked) memory pool + `PinnedBuf<T>`.
2//!
3//! Pinned memory enables true asynchronous H2D / D2H copy. Without it
4//! cudarc's `memcpy_*_async` falls back to a synchronous host copy.
5//!
6//! The pool is an actor at the [`crate::device::DeviceActor`] tier
7//! (sibling to [`crate::device::ContextActor`]) so it survives
8//! context restarts. Acquires a fresh [`PinnedBuf<T>`] from the
9//! free-list; on `Drop` the buffer is returned to the pool via an
10//! actor message so the mailbox is the single owner of the
11//! free-list — no global locks.
12
13mod pinned;
14
15pub use pinned::{
16    PinnedBuf, PinnedBufferPool, PinnedBufferPoolConfig, PinnedPoolMsg, PinnedPoolStats,
17};