Skip to main content

DispatchConfig

Struct DispatchConfig 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

Whether 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§

Source§

impl DispatchConfig

Source

pub fn new( profile: Option<String>, ulp_budget: Option<u8>, timeout: Option<Duration>, label: Option<String>, ) -> Self

Construct a DispatchConfig from explicit fields in one call. Complement to DispatchConfig::default() for external crates that want all optional fields set up front.

Trait Implementations§

Source§

impl Clone for DispatchConfig

Source§

fn clone(&self) -> DispatchConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DispatchConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DispatchConfig

Source§

fn default() -> DispatchConfig

Returns the “default value” for a type. Read more
Source§

impl Eq for DispatchConfig

Source§

impl PartialEq for DispatchConfig

Source§

fn eq(&self, other: &DispatchConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DispatchConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more