pub struct Wrapped<K>(pub K);Expand description
K with no result failing. Each result is K’s, wrapped to its type, as static kinds and NumPy keep integer results. LLVM removes K’s test of whether a result fits, because the loop never reads it. The adapter suits an object whose scalar form is its whole computation, as integer arithmetic’s is.
Tuple Fields§
§0: KTrait Implementations§
Source§impl<T: KernelItem, K: Binary<T>> Binary<T> for Wrapped<K>
impl<T: KernelItem, K: Binary<T>> Binary<T> for Wrapped<K>
fn one(&self, x: T, y: T) -> K::Out
fn judged(&self, x: T, y: T) -> (K::Out, bool)
fn slice( &self, x: [Arg<'_, T>; 2], n: usize, out: &mut [MaybeUninit<K::Out>], ) -> bool
fn checked(&self, x: T, y: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
impl<K: Copy> Copy for Wrapped<K>
Source§impl Inner<i16> for Wrapped<PlusTimes>
impl Inner<i16> for Wrapped<PlusTimes>
Source§fn inner_into(&self, a: &[i16], b: &[i16], size: [usize; 3], out: &mut [i32])
fn inner_into(&self, a: &[i16], b: &[i16], size: [usize; 3], out: &mut [i32])
The
m×n inner product of a, an m×k matrix, and b, a k×n matrix, both row-major, written row-major into out, which holds m×n items. size is [m, k, n]. Where k is 0, each result is the identity of f. An integer result that doesn’t fit its type panics, where checked_into gives false.Source§fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
inner_into’s results, as a new row-major matrix.Source§fn checked_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
) -> bool
fn checked_into( &self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out], ) -> bool
inner_into, or false where an integer result doesn’t fit its type, for callers that keep integers exact or report overflow. Where it gives true, out holds the exact results. Floats always give true.Source§fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
inner of the matrices that a and b give in the orientations given, with size [m, k, n] for those matrices. A transposed a holds a k×m matrix, row-major, and gives its m×k transpose. This default copies a transposed operand into its orientation. Float and complex PlusTimes read it in place.Source§fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
inner_mapped_into’s results, as a new row-major matrix.Source§fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
inner_into of operands whose items come through mappings, as Mapped describes. This default reads each operand whole and copies transposed operands into their orientations. Float and complex PlusTimes read an operand that isn’t held in order one block of its stored rows at a time and multiply each block as it’s read. Only one block of that operand then exists at once.Source§impl Inner<i32> for Wrapped<PlusTimes>
impl Inner<i32> for Wrapped<PlusTimes>
Source§fn inner_into(&self, a: &[i32], b: &[i32], size: [usize; 3], out: &mut [i32])
fn inner_into(&self, a: &[i32], b: &[i32], size: [usize; 3], out: &mut [i32])
The
m×n inner product of a, an m×k matrix, and b, a k×n matrix, both row-major, written row-major into out, which holds m×n items. size is [m, k, n]. Where k is 0, each result is the identity of f. An integer result that doesn’t fit its type panics, where checked_into gives false.Source§fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
inner_into’s results, as a new row-major matrix.Source§fn checked_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
) -> bool
fn checked_into( &self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out], ) -> bool
inner_into, or false where an integer result doesn’t fit its type, for callers that keep integers exact or report overflow. Where it gives true, out holds the exact results. Floats always give true.Source§fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
inner of the matrices that a and b give in the orientations given, with size [m, k, n] for those matrices. A transposed a holds a k×m matrix, row-major, and gives its m×k transpose. This default copies a transposed operand into its orientation. Float and complex PlusTimes read it in place.Source§fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
inner_mapped_into’s results, as a new row-major matrix.Source§fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
inner_into of operands whose items come through mappings, as Mapped describes. This default reads each operand whole and copies transposed operands into their orientations. Float and complex PlusTimes read an operand that isn’t held in order one block of its stored rows at a time and multiply each block as it’s read. Only one block of that operand then exists at once.Source§impl Inner<u8> for Wrapped<PlusTimes>
impl Inner<u8> for Wrapped<PlusTimes>
Source§fn inner_into(&self, a: &[u8], b: &[u8], size: [usize; 3], out: &mut [i32])
fn inner_into(&self, a: &[u8], b: &[u8], size: [usize; 3], out: &mut [i32])
The
m×n inner product of a, an m×k matrix, and b, a k×n matrix, both row-major, written row-major into out, which holds m×n items. size is [m, k, n]. Where k is 0, each result is the identity of f. An integer result that doesn’t fit its type panics, where checked_into gives false.Source§fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
fn inner(&self, a: &[T], b: &[T], size: [usize; 3]) -> Vec<Self::Out>
inner_into’s results, as a new row-major matrix.Source§fn checked_into(
&self,
a: &[T],
b: &[T],
size: [usize; 3],
out: &mut [Self::Out],
) -> bool
fn checked_into( &self, a: &[T], b: &[T], size: [usize; 3], out: &mut [Self::Out], ) -> bool
inner_into, or false where an integer result doesn’t fit its type, for callers that keep integers exact or report overflow. Where it gives true, out holds the exact results. Floats always give true.Source§fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
fn inner_ops(
&self,
a: &[T],
b: &[T],
[oa, ob]: [Orientation; 2],
[m, k, n]: [usize; 3],
) -> Vec<Self::Out>where
T: Copy,
inner of the matrices that a and b give in the orientations given, with size [m, k, n] for those matrices. A transposed a holds a k×m matrix, row-major, and gives its m×k transpose. This default copies a transposed operand into its orientation. Float and complex PlusTimes read it in place.Source§fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
fn inner_mapped(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
orientations: [Orientation; 2],
size: [usize; 3],
) -> Vec<Self::Out>where
T: Element,
inner_mapped_into’s results, as a new row-major matrix.Source§fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
fn inner_mapped_into(
&self,
a: Mapped<'_, T>,
b: Mapped<'_, T>,
[oa, ob]: [Orientation; 2],
size: [usize; 3],
out: &mut [Self::Out],
)where
T: Element,
inner_into of operands whose items come through mappings, as Mapped describes. This default reads each operand whole and copies transposed operands into their orientations. Float and complex PlusTimes read an operand that isn’t held in order one block of its stored rows at a time and multiply each block as it’s read. Only one block of that operand then exists at once.Source§impl Reduction<i16> for Wrapped<Sum>
impl Reduction<i16> for Wrapped<Sum>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i64, b: i64) -> (i64, bool)
fn merge(a: i64, b: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i16]) -> (i64, bool)
fn slice(x: &[i16]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i16], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i16], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i16> for Wrapped<Product>
impl Reduction<i16> for Wrapped<Product>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(x: i64, y: i64) -> (i64, bool)
fn merge(x: i64, y: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i16]) -> (i64, bool)
fn slice(x: &[i16]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i16], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i16], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i32> for Wrapped<Sum>
impl Reduction<i32> for Wrapped<Sum>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i64, b: i64) -> (i64, bool)
fn merge(a: i64, b: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i32]) -> (i64, bool)
fn slice(x: &[i32]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i32], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i32], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i32> for Wrapped<Product>
impl Reduction<i32> for Wrapped<Product>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(x: i64, y: i64) -> (i64, bool)
fn merge(x: i64, y: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i32]) -> (i64, bool)
fn slice(x: &[i32]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i32], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i32], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i64> for Wrapped<Sum>
impl Reduction<i64> for Wrapped<Sum>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i64, b: i64) -> (i64, bool)
fn merge(a: i64, b: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i64]) -> (i64, bool)
fn slice(x: &[i64]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<i64> for Wrapped<Product>
impl Reduction<i64> for Wrapped<Product>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(x: i64, y: i64) -> (i64, bool)
fn merge(x: i64, y: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i64]) -> (i64, bool)
fn slice(x: &[i64]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[i64], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<u8> for Wrapped<Sum>
impl Reduction<u8> for Wrapped<Sum>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(a: i64, b: i64) -> (i64, bool)
fn merge(a: i64, b: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u8]) -> (i64, bool)
fn slice(x: &[u8]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[u8], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[u8], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl Reduction<u8> for Wrapped<Product>
impl Reduction<u8> for Wrapped<Product>
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i64
type Total = i64
The type of a fold: the item type,
i64 for a sum or product of integers narrower than 64 bits, f32 for a sum or product of f16s, i16 for an XNOR of bytes, the C of SumAs, f64 for Squares, a Scaled product for ScaledProduct, or a total with the parity of its count for Alternated.Source§fn unit() -> i64
fn unit() -> i64
The fold of no items: 0, 1, -∞ or ∞, the integer type’s least or greatest value, all ones, or false or true.
Source§fn merge(x: i64, y: i64) -> (i64, bool)
fn merge(x: i64, y: i64) -> (i64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u8]) -> (i64, bool)
fn slice(x: &[u8]) -> (i64, bool)
The fold of
x, which is unit() where x is empty, and whether it fits. The default takes each item in turn by checked.Source§fn scan(x: &[u8], start: Option<i64>, out: &mut Vec<i64>) -> bool
fn scan(x: &[u8], start: Option<i64>, out: &mut Vec<i64>) -> bool
Appends the running folds of
x to out, the first combining start where it is given, and gives whether every one fits. The default takes each item in turn by checked (checked_steps).Source§fn identity() -> Self::Total
fn identity() -> Self::Total
The exact identity of
step, which leaves every total unchanged. For float sums it’s -0.0, because adding unit(), 0.0, turns a total of -0.0 into 0.0. For every other reduction it’s unit().Source§fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
fn checked(acc: Self::Total, x: T) -> (Self::Total, bool)
step, and whether its result fits. An integer sum or product wraps where it doesn’t.Source§fn one(x: T) -> (Self::Total, bool)
fn one(x: T) -> (Self::Total, bool)
The fold of the one item
x, checked(identity(), x), and whether it fits.Source§fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
fn chain(a: Self::Total, b: Self::Total) -> (Self::Total, bool)
merge, for a chain of folds whose every step waits for the one before, as van Herk-Gil-Werman’s suffixes and prefixes do. As in merge, a folds the earlier items. Float maximums and minimums override it with Folds::step_max and step_min, which use AArch64’s one-instruction fmaxnm and fminnm. LLVM can’t vectorize those, so they stay out of merge.Source§fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
fn rows(data: &[T], columns: usize, out: &mut [Self::Total]) -> bool
Folds each row of
data, a matrix with columns items in each row, into the matching item of out, and gives whether every fold fits. The default is fold_rows, which folds each row of 16 items or more by slice. Float sums and products, integer maximums and minimums, and bitwise folds fold rows of 16 to 63 items by checked instead, eight rows side by side (rows_side_by_side). Each of their steps is one instruction, so keeping several rows’ steps in flight costs less than a call of slice for each row. Other reductions keep fold_rows, where slice vectorizes within the row: an integer sum’s step checks for overflow, and a float maximum’s or minimum’s slice runs Folds’ vector kernels. Nobody has timed float maximums side by side since their step became one select on x86.Source§fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
fn short_lanes(
_data: &[T],
_len: usize,
_start: Option<Self::Total>,
_out: &mut Vec<Self::Total>,
) -> Option<bool>where
Self: Sized,
Appends the running folds of
data’s lanes of len consecutive items to out, each lane from start, through a route that runs many short lanes at once, and gives whether every fold fits. A reduction without such a route gives None and appends nothing, as the default does. scan_along then runs the lanes itself. The Boolean reductions run lanes of 1 to 64 items through Logical, 64 items to a word.Source§const SPLIT: usize = 8
const SPLIT: usize = 8
The most classes for which
crate::search::ClassNumbers folds each class into four totals by position. Each step of a class’s total waits on the last through memory, so a reduction whose step takes longer gains from the split over more classes.Source§impl<T, K: Results<T, N>, const N: usize> Results<T, N> for Wrapped<K>
impl<T, K: Results<T, N>, const N: usize> Results<T, N> for Wrapped<K>
Source§impl<T: KernelItem, K: Ternary<T>> Ternary<T> for Wrapped<K>
impl<T: KernelItem, K: Ternary<T>> Ternary<T> for Wrapped<K>
fn one(&self, x: T, y: T, z: T) -> K::Out
fn judged(&self, x: T, y: T, z: T) -> (K::Out, bool)
fn slice( &self, x: [Arg<'_, T>; 3], n: usize, out: &mut [MaybeUninit<K::Out>], ) -> bool
fn checked(&self, x: T, y: T, z: T) -> Option<Self::Out>
fn many( &self, x: Arg<'_, T>, y: Arg<'_, T>, z: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>, ) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
y: Arg<'_, T>,
z: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Source§impl<T: KernelItem, K: Unary<T>> Unary<T> for Wrapped<K>
impl<T: KernelItem, K: Unary<T>> Unary<T> for Wrapped<K>
fn one(&self, x: T) -> K::Out
fn judged(&self, x: T) -> (K::Out, bool)
fn slice( &self, x: [Arg<'_, T>; 1], n: usize, out: &mut [MaybeUninit<K::Out>], ) -> bool
fn checked(&self, x: T) -> Option<Self::Out>
fn many(&self, x: Arg<'_, T>, n: usize, out: &mut Vec<Self::Out>) -> bool
fn many_into(
&self,
x: Arg<'_, T>,
n: usize,
out: &mut Slots<'_, Self::Out>,
) -> boolwhere
T: Copy,
Auto Trait Implementations§
impl<K> Forget for Wrapped<K>
impl<K> Freeze for Wrapped<K>where
K: Freeze,
impl<K> RefUnwindSafe for Wrapped<K>where
K: RefUnwindSafe,
impl<K> Send for Wrapped<K>where
K: Send,
impl<K> Sync for Wrapped<K>where
K: Sync,
impl<K> Unpin for Wrapped<K>where
K: Unpin,
impl<K> UnsafeUnpin for Wrapped<K>where
K: UnsafeUnpin,
impl<K> UnwindSafe for Wrapped<K>where
K: UnwindSafe,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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 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> ⓘ
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