Skip to main content

EighBatchPolicy

Enum EighBatchPolicy 

Source
pub enum EighBatchPolicy {
    AllowPerMatrixFallback,
    RequireBatched,
}
Expand description

Whether a batched EighOptions call may fall back to one launch per matrix.

Self::RequireBatched is the strict contract for a caller that promised one launch per batch: when the selected driver’s single-launch entry point is unavailable, or the provider has no batched routine at all, eigh returns a typed Unsupported error naming the missing capability instead of launching one call per matrix.

A single matrix, and a batch whose size is at most one, already is one call and is never refused.

§Carve-outs: where the policy is not consulted

The policy belongs to the two-output eigh, and it is part of that operation’s identity. A traced graph that keeps only the eigenvalues is pruned to the values-only operation, which carries the driver but has no batch policy at all, and whose recompute is free to take the per-matrix loop:

  • The traced extension op LinalgOp::Eigh is rewritten to LinalgOp::EighVals when the vectors are dead, so a traced eigh_with(RequireBatched) whose values feed the graph can be recomputed one launch per matrix on a cuSOLVER below 11.7.1 without reporting anything.
  • The values-only entries themselves (eigvalsh and friends) are not strict: they carry no EighOptions and always accept the loop.

Ask for the two outputs, or check the result rather than the request, when the launch count has to hold after tracing as well. Both refusals — the CUDA one and the provider-neutral one — are attached to the two-output operation for the same reason: the values-only paths reach the very same batched entry point, so there is no separate capability for them to require.

§Examples

use tenferro_linalg::{EighBatchPolicy, EighOptions};

let options = EighOptions::default().batch_policy(EighBatchPolicy::RequireBatched);
assert_eq!(options.batch_policy, EighBatchPolicy::RequireBatched);
assert_eq!(
    EighOptions::default().batch_policy,
    EighBatchPolicy::AllowPerMatrixFallback,
);

Variants§

§

AllowPerMatrixFallback

Today’s behaviour: a batch takes the single-launch routine when the provider has one and the per-matrix loop when it does not.

§

RequireBatched

Refuse the per-matrix loop. On the CUDA provider this requires cusolverDnXsyevBatched, exported since cuSOLVER 11.7.1.

This binds the two-output eigh only; see the type-level carve-outs for the values-only operation a traced graph is pruned to.

Trait Implementations§

Source§

impl Clone for EighBatchPolicy

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 EighBatchPolicy

Source§

impl Debug for EighBatchPolicy

Source§

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

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

impl Default for EighBatchPolicy

Source§

fn default() -> Self

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

impl Eq for EighBatchPolicy

Source§

impl PartialEq for EighBatchPolicy

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 EighBatchPolicy

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
§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

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
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

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
§

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

§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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.