Skip to main content

ExecutionContext

Struct ExecutionContext 

Source
pub struct ExecutionContext {
    pub parallelism: Parallelism,
    pub determinism: Determinism,
    pub rng: RngFactory,
    pub memory: MemoryBudget,
    pub cancellation: CancellationToken,
    pub progress: Option<Arc<dyn ProgressSink>>,
    pub kernel_policy: KernelPolicy,
    pub cache_policy: CachePolicy,
    pub adaptive_bootstrap: AdaptiveBootstrapBudget,
    pub adaptive_draws: AdaptiveDrawBudget,
}
Expand description

Full execution context passed into algorithms.

Fields§

§parallelism: Parallelism

Parallelism budget.

§determinism: Determinism

Determinism policy.

§rng: RngFactory

RNG factory (no global RNG).

§memory: MemoryBudget

Memory budget.

§cancellation: CancellationToken

Cancellation token.

§progress: Option<Arc<dyn ProgressSink>>

Optional progress sink.

§kernel_policy: KernelPolicy

Kernel selection policy.

§cache_policy: CachePolicy

Cache policy.

§adaptive_bootstrap: AdaptiveBootstrapBudget

Adaptive bootstrap early-stop (estimate SE path).

§adaptive_draws: AdaptiveDrawBudget

Adaptive Bayesian draw early-stop (Laplace / conjugate).

Implementations§

Source§

impl ExecutionContext

Source

pub fn for_tests(seed: u64) -> Self

Construct a serial, strict, scalar-friendly context for tests.

§Examples
use antecedent_core::ExecutionContext;

let ctx = ExecutionContext::for_tests(42);
assert!(!ctx.cancellation.is_cancelled());
Source

pub fn production(seed: u64, max_threads: u32) -> Self

Production context: optimized kernels allowed, cache enabled, bounded threads.

Trait Implementations§

Source§

impl Debug for ExecutionContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.