#[non_exhaustive]pub struct DispatchConfig {
pub profile: Option<String>,
pub ulp_budget: Option<u8>,
pub timeout: Option<Duration>,
pub label: Option<String>,
pub max_output_bytes: Option<usize>,
pub workgroup_override: Option<[u32; 3]>,
pub grid_override: Option<[u32; 3]>,
pub fixpoint_iterations: Option<u32>,
pub speculation: Option<SpeculationMode>,
pub persistent_thread: Option<PersistentThreadMode>,
pub cooperative: bool,
}Expand description
Immutable execution policy supplied by the caller before dispatch.
DispatchConfig is an additive, non-exhaustive struct so that new backend
options (conformance profiles, adapter hints, etc.) can be added without
breaking the frozen VyreBackend::dispatch signature. Backends must treat
every field as read-only policy and must not assume the presence of any
particular option.
§Examples
use vyre::DispatchConfig;
// DispatchConfig is `#[non_exhaustive]`; construct it through
// `default()` and overwrite the fields you want to change.
let mut config = DispatchConfig::default();
config.profile = Some("stress".to_string());
config.ulp_budget = None;Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.profile: Option<String>Optional stable profile identifier such as default, stress, or a
backend-defined conformance mode.
ulp_budget: Option<u8>Optional maximum ULP error budget for approximate transcendental lowering.
None and Some(0) require the strict target-text intrinsic path. A positive
budget allows backends to select fast approximate intrinsic wrappers only
when the wrapper contract is bounded by the supplied ULP ceiling.
timeout: Option<Duration>Optional timeout for the dispatch.
label: Option<String>Optional label for the dispatch (for debugging/profiling).
max_output_bytes: Option<usize>Optional maximum output byte limit.
workgroup_override: Option<[u32; 3]>Optional workgroup size override.
When Some, the backend uses the supplied [x, y, z] workgroup size
instead of the one declared on the vyre_foundation::ir::Program.
This lets callers tune workgroup sizing at dispatch time without
cloning the program metadata. When None (the default), the backend
falls back to Program::workgroup_size.
grid_override: Option<[u32; 3]>Optional grid size override (number of workgroups).
When set, the backend launches the supplied workgroup count instead of the one inferred from the program’s output buffer size. This is required for megakernels where the work queue length is managed through storage buffers rather than the primary output slot.
fixpoint_iterations: Option<u32>Maximum back-to-back dispatch iterations the backend should run on the same persistent input/output handles before reading back the final outputs.
None means one iteration. Some(0) is invalid: backends must reject
it instead of silently rewriting caller policy.
speculation: Option<SpeculationMode>Optional speculation policy.
persistent_thread: Option<PersistentThreadMode>Optional persistent-thread dispatch policy.
cooperative: boolWhether the backend should launch through its cooperative-grid API.
A backend MUST reject cooperative = true with UnsupportedFeature
when its VyreBackend::supports_grid_sync() returns false.
Implementations§
Trait Implementations§
Source§impl Clone for DispatchConfig
impl Clone for DispatchConfig
Source§fn clone(&self) -> DispatchConfig
fn clone(&self) -> DispatchConfig
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 DispatchConfig
impl Debug for DispatchConfig
Source§impl Default for DispatchConfig
impl Default for DispatchConfig
Source§fn default() -> DispatchConfig
fn default() -> DispatchConfig
impl Eq for DispatchConfig
Source§impl PartialEq for DispatchConfig
impl PartialEq for DispatchConfig
Source§fn eq(&self, other: &DispatchConfig) -> bool
fn eq(&self, other: &DispatchConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DispatchConfig
Auto Trait Implementations§
impl Freeze for DispatchConfig
impl RefUnwindSafe for DispatchConfig
impl Send for DispatchConfig
impl Sync for DispatchConfig
impl Unpin for DispatchConfig
impl UnsafeUnpin for DispatchConfig
impl UnwindSafe for DispatchConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.