pub struct BackendCapabilities {
pub cpu: CpuFeatures,
pub metal: bool,
pub cuda: bool,
}Expand description
Backend availability for a codec/runtime combination.
Fields§
§cpu: CpuFeaturesHost CPU feature set.
metal: boolTrue when Metal is available to this crate.
cuda: boolTrue when CUDA is available to this crate.
Implementations§
Source§impl BackendCapabilities
impl BackendCapabilities
Sourcepub fn compile_time_defaults() -> Self
pub fn compile_time_defaults() -> Self
Return default capabilities implied by the current build target.
This does not probe GPU devices or runtime libraries. Codec facades and adapters must further gate the returned device flags by their compiled features and runtime availability.
Sourcepub const fn supports(self, request: BackendRequest) -> bool
pub const fn supports(self, request: BackendRequest) -> bool
Return whether a backend request can be satisfied.
Sourcepub fn resolve(self, request: BackendRequest) -> Option<BackendKind>
pub fn resolve(self, request: BackendRequest) -> Option<BackendKind>
Resolve a backend request to the concrete backend that should run.
Auto resolves to CPU here. Workload-aware device promotion belongs in
codec-specific route planners that have benchmark evidence for the
requested operation.
Sourcepub const fn first_available_accelerator(self) -> Option<BackendKind>
pub const fn first_available_accelerator(self) -> Option<BackendKind>
Return an available accelerator backend without implying it should be selected for a workload.
Trait Implementations§
Source§impl Clone for BackendCapabilities
impl Clone for BackendCapabilities
Source§fn clone(&self) -> BackendCapabilities
fn clone(&self) -> BackendCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BackendCapabilities
Source§impl Debug for BackendCapabilities
impl Debug for BackendCapabilities
impl Eq for BackendCapabilities
Source§impl PartialEq for BackendCapabilities
impl PartialEq for BackendCapabilities
Source§fn eq(&self, other: &BackendCapabilities) -> bool
fn eq(&self, other: &BackendCapabilities) -> bool
self and other values to be equal, and is used by ==.