pub struct OrtGlobalThreadPoolOptions { /* private fields */ }Expand description
Options for sharing one ONNX Runtime thread pool across every session.
Multi-model OCR pipelines otherwise create a full intra-op pool for every
detector, recognizer, classifier, and layout model. Sharing a pool avoids
excess worker creation and cross-pool contention. The environment is
process-global, so commit must be called before any model
session is created.
Implementations§
Source§impl OrtGlobalThreadPoolOptions
impl OrtGlobalThreadPoolOptions
Sourcepub fn new() -> OrtGlobalThreadPoolOptions
pub fn new() -> OrtGlobalThreadPoolOptions
Creates options that retain ONNX Runtime’s default thread counts.
Sourcepub fn with_intra_threads(self, threads: usize) -> OrtGlobalThreadPoolOptions
pub fn with_intra_threads(self, threads: usize) -> OrtGlobalThreadPoolOptions
Sets the process-wide intra-op thread count.
Sourcepub fn with_inter_threads(self, threads: usize) -> OrtGlobalThreadPoolOptions
pub fn with_inter_threads(self, threads: usize) -> OrtGlobalThreadPoolOptions
Sets the process-wide inter-op thread count.
Sourcepub fn with_spin_control(self, allow: bool) -> OrtGlobalThreadPoolOptions
pub fn with_spin_control(self, allow: bool) -> OrtGlobalThreadPoolOptions
Controls whether idle ONNX Runtime workers briefly spin for new work.
Sourcepub fn commit(self) -> Result<bool, OCRError>
pub fn commit(self) -> Result<bool, OCRError>
Commits the process-wide ONNX Runtime environment.
Returns false when another caller already initialized the environment;
in that case these options cannot take effect. Session-local thread counts
should not be configured when a global pool is active.
Trait Implementations§
Source§impl Clone for OrtGlobalThreadPoolOptions
impl Clone for OrtGlobalThreadPoolOptions
Source§fn clone(&self) -> OrtGlobalThreadPoolOptions
fn clone(&self) -> OrtGlobalThreadPoolOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrtGlobalThreadPoolOptions
impl Debug for OrtGlobalThreadPoolOptions
Source§impl Default for OrtGlobalThreadPoolOptions
impl Default for OrtGlobalThreadPoolOptions
Source§fn default() -> OrtGlobalThreadPoolOptions
fn default() -> OrtGlobalThreadPoolOptions
Auto Trait Implementations§
impl Freeze for OrtGlobalThreadPoolOptions
impl RefUnwindSafe for OrtGlobalThreadPoolOptions
impl Send for OrtGlobalThreadPoolOptions
impl Sync for OrtGlobalThreadPoolOptions
impl Unpin for OrtGlobalThreadPoolOptions
impl UnsafeUnpin for OrtGlobalThreadPoolOptions
impl UnwindSafe for OrtGlobalThreadPoolOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.