pub struct BackendConfig {
pub backend_type: BackendType,
pub device_id: Option<i32>,
pub memory_mode: MemoryMode,
pub power_mode: PowerMode,
pub precision_mode: PrecisionMode,
}Expand description
Configuration for a compute backend.
Fields§
§backend_type: BackendTypeThe backend type to use
device_id: Option<i32>Device ID for GPU backends (default: 0)
memory_mode: MemoryModeMemory usage mode
power_mode: PowerModePower usage mode
precision_mode: PrecisionModePrecision mode
Implementations§
Source§impl BackendConfig
impl BackendConfig
Sourcepub fn new(backend_type: BackendType) -> Self
pub fn new(backend_type: BackendType) -> Self
Create a new backend config with default settings.
Sourcepub fn with_device_id(self, id: i32) -> Self
pub fn with_device_id(self, id: i32) -> Self
Set the device ID.
Sourcepub fn with_memory_mode(self, mode: MemoryMode) -> Self
pub fn with_memory_mode(self, mode: MemoryMode) -> Self
Set the memory mode.
Sourcepub fn with_power_mode(self, mode: PowerMode) -> Self
pub fn with_power_mode(self, mode: PowerMode) -> Self
Set the power mode.
Sourcepub fn with_precision_mode(self, mode: PrecisionMode) -> Self
pub fn with_precision_mode(self, mode: PrecisionMode) -> Self
Set the precision mode.
Trait Implementations§
Source§impl Clone for BackendConfig
impl Clone for BackendConfig
Source§fn clone(&self) -> BackendConfig
fn clone(&self) -> BackendConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackendConfig
impl Debug for BackendConfig
Auto Trait Implementations§
impl Freeze for BackendConfig
impl RefUnwindSafe for BackendConfig
impl Send for BackendConfig
impl Sync for BackendConfig
impl Unpin for BackendConfig
impl UnsafeUnpin for BackendConfig
impl UnwindSafe for BackendConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more