Skip to main content

BatchQuery

Struct BatchQuery 

Source
#[non_exhaustive]
pub struct BatchQuery { pub items: usize, pub item_muladds: f64, pub item_parallel: bool, pub balanced_lanes: bool, pub outer_only_when_item_serial: bool, }
Expand description

What one batch of one route looks like to batch_decision.

Work is described by an estimate, not by dimensions: each family supplies the multiply-adds of one item (GEMM mnk, LU n^3/3, solve n^2 k, QR 2mn^2/3, with complex elements weighing four). The booleans and balanced_lanes say what the route permits; they are how the legacy rules above become inputs instead of hidden constants.

§Examples

use tcontract_exec::batch::BatchQuery;

let query = BatchQuery::new(32, 4096.0).with_item_parallel(false);
assert_eq!(query.items, 32);
assert!(!query.item_parallel);

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.
§items: usize

Number of independent items; 0 means there is no work.

§item_muladds: f64

Multiply-adds of one item.

§item_parallel: bool

The route permits item-parallel width greater than one, i.e. item_threads > 1 is meaningful. Auto keeps item threads one when this is false.

§balanced_lanes: bool

Auto may only keep lanes when every lane is non-empty, the split is near-even and the batch alone fills the narrowed budget: the packed driver’s balanced-lanes rule.

§outer_only_when_item_serial: bool

Auto prefers the inner route (one lane, the item kernel gets a team) and fans out over items only when one item alone cannot use a team: the faer batched-GEMM rule. The item width is then the width of one item, not the whole budget.

Implementations§

Source§

impl BatchQuery

Source

pub fn new(items: usize, item_muladds: f64) -> Self

A query for items items of item_muladds multiply-adds each, on a route that permits item parallelism and has no vendor batch route.

Source

pub fn with_item_parallel(self, item_parallel: bool) -> Self

Return this query with the item-parallel capability set.

Source

pub fn with_balanced_lanes(self, balanced_lanes: bool) -> Self

Return this query with the balanced-lanes capability set.

Source

pub fn with_outer_only_when_item_serial(self, value: bool) -> Self

Return this query with the “outer only when one item cannot use a team” capability set (the faer batched-GEMM rule).

Trait Implementations§

Source§

impl Clone for BatchQuery

Source§

fn clone(&self) -> Self

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 Copy for BatchQuery

Source§

impl Debug for BatchQuery

Source§

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

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

impl PartialEq for BatchQuery

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BatchQuery

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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.