Skip to main content

XlogDeviceRuntime

Struct XlogDeviceRuntime 

Source
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

Source

pub fn device_ordinal(&self) -> u32

CUDA ordinal this runtime serves.

Source

pub fn device(&self) -> &Arc<CudaDevice> ⓘ

Borrow the device handle.

Source

pub fn stream_pool(&self) -> &Arc<StreamPool> ⓘ

Borrow the stream pool.

Source

pub fn conditional_graph_stats(&self) -> ConditionalGraphStats

Snapshot conditional-graph execution counters.

Source

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.

Source

pub fn event_lifecycle_stats(&self) -> EventLifecycleStats

Snapshot resident completion-event lifetime counters.

Source

pub fn resident_graph_handle_lifecycle_stats( &self, ) -> ResidentGraphHandleLifecycleStats

Snapshot resident graph-handle lifetime counters.

Source

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.

Source

pub fn deallocate(&self, block: DeviceBlock) -> ResourceResult<()>

Deallocate via the underlying resource.

Source

pub fn bytes_outstanding(&self) -> usize

Sum of bytes currently outstanding on this device, as reported by the underlying resource.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.