pub struct OxiblasThreadConfig {
pub num_threads: usize,
pub stack_size: usize,
pub thread_name: Option<String>,
}Expand description
Configuration for the OxiBLAS thread pool.
OxiblasThreadConfig gathers all knobs that influence how OxiBLAS
chooses threads for parallel operations. Build one with the fluent
builder methods, then apply it via set_global_thread_pool or
with_thread_count.
§Example
use oxiblas_core::parallel::OxiblasThreadConfig;
let cfg = OxiblasThreadConfig::new()
.num_threads(4)
.stack_size(2 * 1024 * 1024);
println!("threads: {}", cfg.num_threads);Fields§
§num_threads: usizeNumber of worker threads. 0 means “use all logical CPUs”.
stack_size: usizePer-thread stack size in bytes. 0 means “use OS default”.
thread_name: Option<String>Human-readable name prefix for spawned threads.
Implementations§
Source§impl OxiblasThreadConfig
impl OxiblasThreadConfig
Sourcepub fn num_threads(self, n: usize) -> Self
pub fn num_threads(self, n: usize) -> Self
Sets the desired thread count. Pass 0 for “all CPUs”.
Sourcepub fn stack_size(self, bytes: usize) -> Self
pub fn stack_size(self, bytes: usize) -> Self
Sets the per-thread stack size. Pass 0 for the OS default.
Sourcepub fn thread_name(self, name: impl Into<String>) -> Self
pub fn thread_name(self, name: impl Into<String>) -> Self
Sets a human-readable name prefix for spawned threads.
Sourcepub fn effective_threads(&self) -> usize
pub fn effective_threads(&self) -> usize
Returns the effective thread count, substituting the available
logical CPU count when num_threads is 0.
Trait Implementations§
Source§impl Clone for OxiblasThreadConfig
impl Clone for OxiblasThreadConfig
Source§fn clone(&self) -> OxiblasThreadConfig
fn clone(&self) -> OxiblasThreadConfig
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 OxiblasThreadConfig
impl Debug for OxiblasThreadConfig
Source§impl Default for OxiblasThreadConfig
impl Default for OxiblasThreadConfig
Source§fn default() -> OxiblasThreadConfig
fn default() -> OxiblasThreadConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OxiblasThreadConfig
impl RefUnwindSafe for OxiblasThreadConfig
impl Send for OxiblasThreadConfig
impl Sync for OxiblasThreadConfig
impl Unpin for OxiblasThreadConfig
impl UnsafeUnpin for OxiblasThreadConfig
impl UnwindSafe for OxiblasThreadConfig
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