Struct basic_dsp::MultiCoreSettings
source · [−]#[repr(C)]pub struct MultiCoreSettings {
pub core_limit: usize,
pub med_dual_core_threshold: usize,
pub med_multi_core_threshold: usize,
pub large_dual_core_threshold: usize,
pub large_multi_core_threshold: usize,
}
Expand description
Holds parameters which specify how multiple cores are used to execute an operation.
Fields
core_limit: usize
All operations will be limited to not create more threads than specified here
med_dual_core_threshold: usize
med_multi_core_threshold: usize
large_dual_core_threshold: usize
large_multi_core_threshold: usize
Implementations
sourceimpl MultiCoreSettings
impl MultiCoreSettings
sourcepub fn default() -> MultiCoreSettings
pub fn default() -> MultiCoreSettings
Creates multi core settings with default values
sourcepub fn single_threaded() -> MultiCoreSettings
pub fn single_threaded() -> MultiCoreSettings
Creates multi core settings so that no thread will be spawned.
sourcepub fn parallel() -> MultiCoreSettings
pub fn parallel() -> MultiCoreSettings
Creates multi core so that threads will be spawned if this appears to be beneficial.
sourcepub fn new(core_limit: usize) -> MultiCoreSettings
pub fn new(core_limit: usize) -> MultiCoreSettings
Creates multi core settings with the given values.
If core_limit > 1
then the first time this function is executed a calibration run
will be performed which determines the details for the multi threading strategy. This
run takes between 200ms and 500ms.
sourcepub fn with_thresholds(
core_limit: usize,
med_dual_core_threshold: usize,
med_multi_core_threshold: usize,
large_dual_core_threshold: usize,
large_multi_core_threshold: usize
) -> MultiCoreSettings
pub fn with_thresholds(
core_limit: usize,
med_dual_core_threshold: usize,
med_multi_core_threshold: usize,
large_dual_core_threshold: usize,
large_multi_core_threshold: usize
) -> MultiCoreSettings
Creates multi core settings with explicit thresholds.
The arguments allow to specify the number of cores which are used at maximum and as
well as starting from which slice size the lib will start to use two or all cores.
med
denotes operations of medium complexity, e.g. such as log and sin.
large
denotes operations like convolution and interpolation.
Trait Implementations
sourceimpl Clone for MultiCoreSettings
impl Clone for MultiCoreSettings
sourcefn clone(&self) -> MultiCoreSettings
fn clone(&self) -> MultiCoreSettings
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more