pub struct ScheduleConfig {
pub backend_config: BackendConfig,
pub num_threads: u32,
}Expand description
Schedule configuration for creating sessions.
This configuration determines how MNN will execute the model, including backend selection, thread count, and optimization settings.
Fields§
§backend_config: BackendConfigBackend configuration
num_threads: u32Number of threads for CPU backend (default: 4)
Implementations§
Source§impl ScheduleConfig
impl ScheduleConfig
Sourcepub fn with_backend(backend: BackendType) -> Self
pub fn with_backend(backend: BackendType) -> Self
Create a schedule config for a specific backend type.
Sourcepub fn backend(self, backend: BackendType) -> Self
pub fn backend(self, backend: BackendType) -> Self
Set the backend type.
Sourcepub fn num_threads(self, threads: u32) -> Self
pub fn num_threads(self, threads: u32) -> Self
Set the number of threads for CPU backend.
Sourcepub fn memory_mode(self, mode: MemoryMode) -> Self
pub fn memory_mode(self, mode: MemoryMode) -> Self
Set the memory mode.
Sourcepub fn power_mode(self, mode: PowerMode) -> Self
pub fn power_mode(self, mode: PowerMode) -> Self
Set the power mode.
Sourcepub fn precision_mode(self, mode: PrecisionMode) -> Self
pub fn precision_mode(self, mode: PrecisionMode) -> Self
Set the precision mode.
Trait Implementations§
Source§impl Clone for ScheduleConfig
impl Clone for ScheduleConfig
Source§fn clone(&self) -> ScheduleConfig
fn clone(&self) -> ScheduleConfig
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 ScheduleConfig
impl Debug for ScheduleConfig
Auto Trait Implementations§
impl Freeze for ScheduleConfig
impl RefUnwindSafe for ScheduleConfig
impl Send for ScheduleConfig
impl Sync for ScheduleConfig
impl Unpin for ScheduleConfig
impl UnsafeUnpin for ScheduleConfig
impl UnwindSafe for ScheduleConfig
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