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
impl GpuBackendDeviceProfile
Sourcepub fn new(device_ordinal: usize) -> Self
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.
Sourcepub fn with_memory_limit(self, memory_limit: GpuDeviceMemoryLimit) -> Self
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.
Sourcepub fn with_device_capabilities(
self,
device_capabilities: DeviceCapabilities,
) -> Self
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.
Sourcepub fn with_backend_reserve_bytes(self, backend_reserve_bytes: u64) -> Self
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.
Sourcepub fn with_cache_cap_bytes(self, cache_cap_bytes: u64) -> Self
pub fn with_cache_cap_bytes(self, cache_cap_bytes: u64) -> Self
Sets the aggregate accounted resident-cache ceiling for this device.
Sourcepub fn cache_cap_bytes(&self) -> u64
pub fn cache_cap_bytes(&self) -> u64
Returns the accounted resident-cache ceiling in bytes. The default is zero.
Sourcepub fn with_default_query_limit_bytes(
self,
default_query_limit_bytes: u64,
) -> Self
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.
Sourcepub fn with_source_work_per_attempt(
self,
source_work_per_attempt: usize,
) -> Self
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.
Sourcepub fn with_max_active_attempts(self, max_active_attempts: usize) -> Self
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.
Sourcepub fn with_derived_installation_bounds(
self,
max_active_attempts: usize,
) -> Self
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.
Sourcepub fn with_installation_bounds(
self,
installation_bounds: GpuBackendDeviceInstallationBounds,
) -> Self
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.
Sourcepub fn with_telemetry(self, install_telemetry: bool) -> Self
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.
Sourcepub fn device_ordinal(&self) -> usize
pub fn device_ordinal(&self) -> usize
Returns the CUDA device ordinal selected by this declaration.
Sourcepub fn device_capabilities(&self) -> &DeviceCapabilities
pub fn device_capabilities(&self) -> &DeviceCapabilities
Immutable native execution capabilities selected for this device.
Sourcepub fn memory_limit(&self) -> GpuDeviceMemoryLimit
pub fn memory_limit(&self) -> GpuDeviceMemoryLimit
Returns the unresolved admission capacity policy, resolved at device discovery.
Sourcepub fn backend_reserve_bytes(&self) -> u64
pub fn backend_reserve_bytes(&self) -> u64
Returns bytes reserved outside managed query and cache capacity. The default is zero.
Sourcepub fn default_query_limit_bytes(&self) -> Option<u64>
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.
Sourcepub fn source_work_per_attempt(&self) -> usize
pub fn source_work_per_attempt(&self) -> usize
Returns auxiliary source-work slots reserved for each active attempt. The default is one.
Sourcepub fn max_active_attempts(&self) -> usize
pub fn max_active_attempts(&self) -> usize
Returns the maximum simultaneously admitted attempts on this device. The default is two.
Sourcepub fn installation_bounds(&self) -> Option<GpuBackendDeviceInstallationBounds>
pub fn installation_bounds(&self) -> Option<GpuBackendDeviceInstallationBounds>
Returns the explicit installation bounds. None requests the values
returned by Self::derived_installation_bounds.
Sourcepub fn derived_installation_bounds(
&self,
) -> Result<GpuBackendDeviceInstallationBounds>
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.
Sourcepub fn install_telemetry(&self) -> bool
pub fn install_telemetry(&self) -> bool
Returns whether device telemetry is installed. New profiles enable it.
Trait Implementations§
Source§impl Clone for GpuBackendDeviceProfile
impl Clone for GpuBackendDeviceProfile
Source§impl Debug for GpuBackendDeviceProfile
impl Debug for GpuBackendDeviceProfile
impl Eq for GpuBackendDeviceProfile
Source§impl PartialEq for GpuBackendDeviceProfile
impl PartialEq for GpuBackendDeviceProfile
impl StructuralPartialEq for GpuBackendDeviceProfile
Auto Trait Implementations§
impl Freeze for GpuBackendDeviceProfile
impl RefUnwindSafe for GpuBackendDeviceProfile
impl Send for GpuBackendDeviceProfile
impl Sync for GpuBackendDeviceProfile
impl Unpin for GpuBackendDeviceProfile
impl UnsafeUnpin for GpuBackendDeviceProfile
impl UnwindSafe for GpuBackendDeviceProfile
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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