Skip to main content

GpuBackendSession

Struct GpuBackendSession 

Source
pub struct GpuBackendSession { /* private fields */ }
Expand description

Opaque capability installed into session/optimizer state.

It cannot construct or expose raw runtime resources and its weak resource reference cannot keep device ownership alive after public facade close.

Implementations§

Source§

impl GpuBackendSession

Source

pub fn identity(&self) -> GpuBackendCoreIdentity

Source

pub fn is_closing(&self) -> bool

Returns whether the backend close gate has been signalled.

An attempt that won the begin gate reads this flag and terminalizes unplanned with backend_closing evidence. Planning does not start in that case. The begin gate itself remains the only linearization point.

Source

pub fn begin_attempt( &self, request: BeginAttemptRequest, ) -> Result<AttemptBegin>

Begins one attempt lifecycle under this backend’s observation scope.

The observation permit is the linearization point: an attempt that obtains it is counted in attempts_begun and holds the observation scope open until its report is ready, so close cannot complete without that report. A begin that loses to close fails with backend_closing and leaves no counted attempt. No GPU permit is taken here; the attempt claims a device only when its first native fragment is admitted.

Source

pub fn backend_metrics_snapshot(&self) -> BackendMetricsSnapshot

Returns the same coherent generation snapshot exposed by the owning backend core without requiring access to live GPU resources.

Source

pub fn take_abandoned_attempt_reports( &self, max: usize, ) -> Vec<Arc<QueryAttemptReport>>

Drains up to max reports of attempts whose completion receiver was dropped before the report was ready. Empty when the backend was built without an attempt completion queue.

Source

pub fn attempt_counters_snapshot(&self) -> AttemptBackendCountersSnapshot

Source

pub async fn admit_async_with_request( &self, request: QueryAdmissionRequest, ) -> Result<QueryHandle>

Admits one native attempt, waiting in the bounded admission queue until a grant is placed, the request is cancelled, or its queue deadline passes.

The observation and GPU permits are taken before the request enters the queue and travel with it inside its QueryCompletion, so an attempt that is queued, admitted, or cleaning up holds the resource generation for its whole lifetime, and close waits for it. On a rejected or cancelled request the GPU permit is released before the observation is sealed and delivered, the observation permit covers that delivery and is released afterwards, and the opaque activity lease runs last because its destructor may reenter close. Failures before the queue carry backend_closing (Cancelled); failures inside the queue are the admission controller’s (ServiceOverloaded for a full queue or an elapsed wait, the typed capability or health rejections otherwise).

Source

pub fn same_backend(&self, other: &Self) -> bool

Whether both sessions were minted from the same published core.

Source

pub fn diagnostics(&self) -> Result<BackendDiagnostics>

Reads every service report once. Like every service read, it fails with backend_closing once close begins.

Source

pub fn device_telemetry_snapshots(&self) -> Result<Vec<DeviceTelemetrySnapshot>>

Trait Implementations§

Source§

impl Clone for GpuBackendSession

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuBackendSession

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more