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
impl GpuBackendSession
pub fn identity(&self) -> GpuBackendCoreIdentity
Sourcepub fn is_closing(&self) -> bool
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.
Sourcepub fn begin_attempt(
&self,
request: BeginAttemptRequest,
) -> Result<AttemptBegin>
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.
Sourcepub fn backend_metrics_snapshot(&self) -> BackendMetricsSnapshot
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.
Sourcepub fn take_abandoned_attempt_reports(
&self,
max: usize,
) -> Vec<Arc<QueryAttemptReport>>
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.
pub fn attempt_counters_snapshot(&self) -> AttemptBackendCountersSnapshot
Sourcepub async fn admit_async_with_request(
&self,
request: QueryAdmissionRequest,
) -> Result<QueryHandle>
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).
Sourcepub fn same_backend(&self, other: &Self) -> bool
pub fn same_backend(&self, other: &Self) -> bool
Whether both sessions were minted from the same published core.
Sourcepub fn diagnostics(&self) -> Result<BackendDiagnostics>
pub fn diagnostics(&self) -> Result<BackendDiagnostics>
Reads every service report once. Like every service read, it fails
with backend_closing once close begins.
pub fn device_telemetry_snapshots(&self) -> Result<Vec<DeviceTelemetrySnapshot>>
Trait Implementations§
Source§impl Clone for GpuBackendSession
impl Clone for GpuBackendSession
Auto Trait Implementations§
impl Freeze for GpuBackendSession
impl RefUnwindSafe for GpuBackendSession
impl Send for GpuBackendSession
impl Sync for GpuBackendSession
impl Unpin for GpuBackendSession
impl UnsafeUnpin for GpuBackendSession
impl UnwindSafe for GpuBackendSession
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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