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: ParallelismParallelism budget.
determinism: DeterminismDeterminism policy.
rng: RngFactoryRNG factory (no global RNG).
memory: MemoryBudgetMemory budget.
cancellation: CancellationTokenCancellation token.
progress: Option<Arc<dyn ProgressSink>>Optional progress sink.
kernel_policy: KernelPolicyKernel selection policy.
cache_policy: CachePolicyCache policy.
adaptive_bootstrap: AdaptiveBootstrapBudgetAdaptive bootstrap early-stop (estimate SE path).
adaptive_draws: AdaptiveDrawBudgetAdaptive Bayesian draw early-stop (Laplace / conjugate).
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn for_tests(seed: u64) -> Self
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());Sourcepub fn production(seed: u64, max_threads: u32) -> Self
pub fn production(seed: u64, max_threads: u32) -> Self
Production context: optimized kernels allowed, cache enabled, bounded threads.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionContext
impl !UnwindSafe for ExecutionContext
impl Freeze for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
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