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::Eighis rewritten toLinalgOp::EighValswhen the vectors are dead, so a tracedeigh_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 (
eigvalshand friends) are not strict: they carry noEighOptionsand 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
impl Clone for EighBatchPolicy
impl Copy for EighBatchPolicy
Source§impl Debug for EighBatchPolicy
impl Debug for EighBatchPolicy
Source§impl Default for EighBatchPolicy
impl Default for EighBatchPolicy
impl Eq for EighBatchPolicy
Source§impl PartialEq for EighBatchPolicy
impl PartialEq for EighBatchPolicy
impl StructuralPartialEq for EighBatchPolicy
Auto Trait Implementations§
impl Freeze for EighBatchPolicy
impl RefUnwindSafe for EighBatchPolicy
impl Send for EighBatchPolicy
impl Sync for EighBatchPolicy
impl Unpin for EighBatchPolicy
impl UnsafeUnpin for EighBatchPolicy
impl UnwindSafe for EighBatchPolicy
Blanket Implementations§
impl<T> Boilerplate for T
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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