pub struct DeviceBlock {
pub ptr: u64,
pub device_ordinal: u32,
pub alloc_stream: StreamId,
pub bytes: usize,
pub align: usize,
pub tag: AllocTag,
pub generation: Generation,
pub state: BlockState,
}Expand description
One outstanding device-memory allocation. Owned by the caller until
returned to its originating resource via
DeviceMemoryResource::deallocate.
Carries the metadata required for stream-ordered correctness and post-mortem debugging: the resource that owns the block, the device ordinal, the stream the allocation is bound to, byte size, alignment, caller tag, generation number, and current state.
Fields§
§ptr: u64Raw device pointer (opaque to safe Rust callers).
device_ordinal: u32CUDA ordinal of the device this block lives on.
alloc_stream: StreamIdAllocation stream. Reads/writes on a different stream require explicit synchronization (event wait or device sync).
bytes: usizeSize in bytes. May exceed the caller-requested size when the resource rounds up for alignment or pool granularity.
align: usizeAlignment in bytes (always ≥ caller request).
tag: AllocTagCaller-supplied tag, surfaced in allocation logs.
generation: GenerationMonotonic generation. Reused addresses get fresh generations.
state: BlockStateCurrent state. Adaptors transition this; tests assert on it.