Skip to main content

GpuBackendDeviceProfile

Struct GpuBackendDeviceProfile 

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

Pure per-device construction profile validated before owner acquisition.

Encapsulates device-local resource policies and configuration defaults, including capacity, reserve, query limit, active-attempt count, source work, installation bounds, capabilities, and telemetry. Retains no memory ownership; the deployment owner binds a profile with explicit GpuMemoryOwnership via GpuBackendDeviceConfig::new.

Implementations§

Source§

impl GpuBackendDeviceProfile

Source

pub fn new(device_ordinal: usize) -> Self

Starts a profile with automatic capacity discovery and two active attempts. Callers may override any device-local bound below.

Source

pub fn with_memory_limit(self, memory_limit: GpuDeviceMemoryLimit) -> Self

Sets the admission capacity policy. Validation and device discovery resolve the policy before managed capacity is installed.

Source

pub fn with_device_capabilities( self, device_capabilities: DeviceCapabilities, ) -> Self

Freezes the native execution capabilities available on this device.

The default accepts every capability with a modeled native contract. Supplying an exact profile is useful for heterogeneous deployments and is consumed by admission before any waiter is queued.

Source

pub fn with_backend_reserve_bytes(self, backend_reserve_bytes: u64) -> Self

Sets bytes reserved outside managed query and cache capacity. Backend construction rejects a reserve that leaves no managed capacity.

Source

pub fn with_cache_cap_bytes(self, cache_cap_bytes: u64) -> Self

Sets the aggregate accounted resident-cache ceiling for this device.

Source

pub fn cache_cap_bytes(&self) -> u64

Returns the accounted resident-cache ceiling in bytes. The default is zero.

Source

pub fn with_default_query_limit_bytes( self, default_query_limit_bytes: u64, ) -> Self

Sets the immutable default memory limit for each query on this device. When unset, it resolves to the query share divided by the maximum active-attempt count, rounded down to whole bytes.

Source

pub fn with_source_work_per_attempt( self, source_work_per_attempt: usize, ) -> Self

Sets source work reserved per active attempt.

This is part of the immutable device envelope; execution/session source scheduling controls must not change controller capacity.

Source

pub fn with_max_active_attempts(self, max_active_attempts: usize) -> Self

Sets the device admission concurrency bound. Zero is rejected by backend validation; existing explicit installation bounds remain in force.

Source

pub fn with_derived_installation_bounds( self, max_active_attempts: usize, ) -> Self

Sets the active-attempt limit and clears explicit installation bounds so construction derives them from this profile.

Prefer this over spelling with_max_active_attempts plus with_installation_bounds separately: the pair carries the same number twice with no type-level guarantee they agree. Explicit bounds remain available through with_installation_bounds for deployments that deliberately overprovision stream or worker capacity.

Source

pub fn with_installation_bounds( self, installation_bounds: GpuBackendDeviceInstallationBounds, ) -> Self

Sets explicit stream, worker, and execution-lane bounds.

Most callers should prefer Self::with_derived_installation_bounds; use this only to deliberately overprovision beyond the derived A_d * (1 + S_d) stream formula.

Source

pub fn with_telemetry(self, install_telemetry: bool) -> Self

Enables or disables installation of diagnostic device telemetry. Telemetry does not participate in query admission accounting.

Source

pub fn device_ordinal(&self) -> usize

Returns the CUDA device ordinal selected by this declaration.

Source

pub fn device_capabilities(&self) -> &DeviceCapabilities

Immutable native execution capabilities selected for this device.

Source

pub fn memory_limit(&self) -> GpuDeviceMemoryLimit

Returns the unresolved admission capacity policy, resolved at device discovery.

Source

pub fn backend_reserve_bytes(&self) -> u64

Returns bytes reserved outside managed query and cache capacity. The default is zero.

Source

pub fn default_query_limit_bytes(&self) -> Option<u64>

Returns the explicit default query grant in bytes. None requests floor((managed_capacity_bytes - cache_cap_bytes) / max_active_attempts) after device capacity resolution.

Source

pub fn source_work_per_attempt(&self) -> usize

Returns auxiliary source-work slots reserved for each active attempt. The default is one.

Source

pub fn max_active_attempts(&self) -> usize

Returns the maximum simultaneously admitted attempts on this device. The default is two.

Source

pub fn installation_bounds(&self) -> Option<GpuBackendDeviceInstallationBounds>

Returns the explicit installation bounds. None requests the values returned by Self::derived_installation_bounds.

Source

pub fn derived_installation_bounds( &self, ) -> Result<GpuBackendDeviceInstallationBounds>

The installation bounds a profile without explicit ones receives: A_d * (1 + S_d) stream slots, A_d execution lanes, and one worker per active attempt plus the worker reserved for context setup and release cleanup. Explicit bounds must cover the stream slots and workers of this derivation.

Source

pub fn install_telemetry(&self) -> bool

Returns whether device telemetry is installed. New profiles enable it.

Trait Implementations§

Source§

impl Clone for GpuBackendDeviceProfile

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 GpuBackendDeviceProfile

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for GpuBackendDeviceProfile

Source§

impl PartialEq for GpuBackendDeviceProfile

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GpuBackendDeviceProfile

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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