pub struct XlogDeviceRuntime { /* private fields */ }Expand description
Provider-owned CUDA device runtime.
Owns the device handle, stream pool, and resource stack. Allocation and deallocation calls forward through the canonical provider-built stack: optional logging over one global byte budget and the asynchronous CUDA allocator. Tests may inject a different stack through the crate-private constructor.
Implementations§
Source§impl XlogDeviceRuntime
impl XlogDeviceRuntime
Sourcepub fn device_ordinal(&self) -> u32
pub fn device_ordinal(&self) -> u32
CUDA ordinal this runtime serves.
Sourcepub fn device(&self) -> &Arc<CudaDevice> ⓘ
pub fn device(&self) -> &Arc<CudaDevice> ⓘ
Borrow the device handle.
Sourcepub fn stream_pool(&self) -> &Arc<StreamPool> ⓘ
pub fn stream_pool(&self) -> &Arc<StreamPool> ⓘ
Borrow the stream pool.
Sourcepub fn conditional_graph_stats(&self) -> ConditionalGraphStats
pub fn conditional_graph_stats(&self) -> ConditionalGraphStats
Snapshot conditional-graph execution counters.
Sourcepub fn reset_conditional_graph_stats(&self)
pub fn reset_conditional_graph_stats(&self)
Reset per-execution conditional-graph counters.
Handle and event lifetime counters are intentionally cumulative and are not reset because callers compare snapshots around an execution.
Sourcepub fn event_lifecycle_stats(&self) -> EventLifecycleStats
pub fn event_lifecycle_stats(&self) -> EventLifecycleStats
Snapshot resident completion-event lifetime counters.
Sourcepub fn resident_graph_handle_lifecycle_stats(
&self,
) -> ResidentGraphHandleLifecycleStats
pub fn resident_graph_handle_lifecycle_stats( &self, ) -> ResidentGraphHandleLifecycleStats
Snapshot resident graph-handle lifetime counters.
Sourcepub fn allocate(
&self,
bytes: usize,
stream: StreamId,
tag: AllocTag,
) -> ResourceResult<DeviceBlock>
pub fn allocate( &self, bytes: usize, stream: StreamId, tag: AllocTag, ) -> ResourceResult<DeviceBlock>
Allocate via the underlying resource. Stream-ordered: the
returned DeviceBlock is bound to stream.
Sourcepub fn deallocate(&self, block: DeviceBlock) -> ResourceResult<()>
pub fn deallocate(&self, block: DeviceBlock) -> ResourceResult<()>
Deallocate via the underlying resource.
Sourcepub fn bytes_outstanding(&self) -> usize
pub fn bytes_outstanding(&self) -> usize
Sum of bytes currently outstanding on this device, as reported by the underlying resource.
Sourcepub fn reap_pending(&self) -> ResourceResult<()>
pub fn reap_pending(&self) -> ResourceResult<()>
Drain pending async frees on the underlying resource. No-op
for synchronous backends. Callers that need an accurate
bytes_outstanding reading after a burst of asynchronous
deallocations should call this first.
Sourcepub fn record_block_use(
&self,
block: &DeviceBlock,
use_stream: StreamId,
) -> ResourceResult<()>
pub fn record_block_use( &self, block: &DeviceBlock, use_stream: StreamId, ) -> ResourceResult<()>
Record that work has been (or is being) submitted on
use_stream that touches block. Forwards to the
underlying resource stack
(LoggingResource → GlobalDeviceBudget → AsyncCudaResource),
where the stream-ordered backend attaches a CUDA event so
block.alloc_stream waits on it before the queued
cuMemFreeAsync runs. This is the production-reachable
hook used by provider-recorded launches for read, write, and
read_write buffer arguments. Callers that submit raw CUDA work on a
stream other than block.alloc_stream must call this directly.
See DeviceMemoryResource::record_block_use for the
underlying contract.
Sourcepub fn supports_block_use_tracking(&self) -> bool
pub fn supports_block_use_tracking(&self) -> bool
Whether the active resource stack tracks cross-stream
uses (i.e., supports record_block_use). The launch
recorder’s preflight checks this BEFORE queuing CUDA
work, so a misconfigured runtime fails loudly at the
boundary rather than after the launch is in flight.