pub struct Max;Expand description
max as a Reduction. Its step on floats is maximum of the item and the total, which a NaN item leaves unchanged. Every fold and scan starts at -∞, and AArch64’s and wasm’s vector folds keep the running result beside a NaN item, as that step does. So a NaN item changes no running result on any target, and a fold of NaN items alone gives -∞.
Trait Implementations§
impl Copy for Max
Source§impl<F> Reduction<F> for Maxwhere
F: Native,
impl<F> Reduction<F> for Maxwhere
F: Native,
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§const SPLIT: usize = 64
const SPLIT: usize = 64
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§type Total = F
type Total = F
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() -> F
fn unit() -> F
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: F, b: F) -> (F, bool)
fn merge(a: F, b: F) -> (F, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn chain(a: F, b: F) -> (F, bool)
fn chain(a: F, b: F) -> (F, 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 slice(x: &[F]) -> (F, bool)
fn slice(x: &[F]) -> (F, 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: &[F], start: Option<F>, out: &mut Vec<F>) -> bool
fn scan(x: &[F], start: Option<F>, out: &mut Vec<F>) -> 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 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§impl Reduction<bool> for Max
impl Reduction<bool> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = bool
type Total = bool
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() -> bool
fn unit() -> bool
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: bool, b: bool) -> (bool, bool)
fn merge(a: bool, b: bool) -> (bool, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[bool]) -> (bool, bool)
fn slice(x: &[bool]) -> (bool, 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: &[bool], start: Option<bool>, out: &mut Vec<bool>) -> bool
fn scan(x: &[bool], start: Option<bool>, out: &mut Vec<bool>) -> 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 short_lanes(
data: &[bool],
len: usize,
start: Option<bool>,
out: &mut Vec<bool>,
) -> Option<bool>
fn short_lanes( data: &[bool], len: usize, start: Option<bool>, out: &mut Vec<bool>, ) -> Option<bool>
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§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§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<f16> for Max
impl Reduction<f16> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = f16
type Total = f16
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() -> f16
fn unit() -> f16
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: f16, b: f16) -> (f16, bool)
fn merge(a: f16, b: f16) -> (f16, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn identity() -> f16
fn identity() -> f16
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 slice(x: &[f16]) -> (f16, bool)
fn slice(x: &[f16]) -> (f16, 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: &[f16], start: Option<f16>, out: &mut Vec<f16>) -> bool
fn scan(x: &[f16], start: Option<f16>, out: &mut Vec<f16>) -> 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 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 Max
impl Reduction<i16> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i16
type Total = i16
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() -> i16
fn unit() -> i16
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: i16, b: i16) -> (i16, bool)
fn merge(a: i16, b: i16) -> (i16, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i16]) -> (i16, bool)
fn slice(x: &[i16]) -> (i16, 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<i16>, out: &mut Vec<i16>) -> bool
fn scan(x: &[i16], start: Option<i16>, out: &mut Vec<i16>) -> 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 rows(data: &[i16], columns: usize, out: &mut [i16]) -> bool
fn rows(data: &[i16], columns: usize, out: &mut [i16]) -> 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 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 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 Max
impl Reduction<i32> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = i32
type Total = i32
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() -> i32
fn unit() -> i32
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: i32, b: i32) -> (i32, bool)
fn merge(a: i32, b: i32) -> (i32, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[i32]) -> (i32, bool)
fn slice(x: &[i32]) -> (i32, 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<i32>, out: &mut Vec<i32>) -> bool
fn scan(x: &[i32], start: Option<i32>, out: &mut Vec<i32>) -> 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 rows(data: &[i32], columns: usize, out: &mut [i32]) -> bool
fn rows(data: &[i32], columns: usize, out: &mut [i32]) -> 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 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 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 Max
impl Reduction<i64> for Max
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 rows(data: &[i64], columns: usize, out: &mut [i64]) -> bool
fn rows(data: &[i64], columns: usize, out: &mut [i64]) -> 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 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 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 Max
impl Reduction<u8> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = u8
type Total = u8
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() -> u8
fn unit() -> u8
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: u8, b: u8) -> (u8, bool)
fn merge(a: u8, b: u8) -> (u8, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u8]) -> (u8, bool)
fn slice(x: &[u8]) -> (u8, 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<u8>, out: &mut Vec<u8>) -> bool
fn scan(x: &[u8], start: Option<u8>, out: &mut Vec<u8>) -> 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 rows(data: &[u8], columns: usize, out: &mut [u8]) -> bool
fn rows(data: &[u8], columns: usize, out: &mut [u8]) -> 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 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 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<u16> for Max
impl Reduction<u16> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = u16
type Total = u16
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() -> u16
fn unit() -> u16
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: u16, b: u16) -> (u16, bool)
fn merge(a: u16, b: u16) -> (u16, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u16]) -> (u16, bool)
fn slice(x: &[u16]) -> (u16, 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: &[u16], start: Option<u16>, out: &mut Vec<u16>) -> bool
fn scan(x: &[u16], start: Option<u16>, out: &mut Vec<u16>) -> 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 rows(data: &[u16], columns: usize, out: &mut [u16]) -> bool
fn rows(data: &[u16], columns: usize, out: &mut [u16]) -> 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 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 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<u32> for Max
impl Reduction<u32> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = u32
type Total = u32
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() -> u32
fn unit() -> u32
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: u32, b: u32) -> (u32, bool)
fn merge(a: u32, b: u32) -> (u32, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u32]) -> (u32, bool)
fn slice(x: &[u32]) -> (u32, 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: &[u32], start: Option<u32>, out: &mut Vec<u32>) -> bool
fn scan(x: &[u32], start: Option<u32>, out: &mut Vec<u32>) -> 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 rows(data: &[u32], columns: usize, out: &mut [u32]) -> bool
fn rows(data: &[u32], columns: usize, out: &mut [u32]) -> 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 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 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<u64> for Max
impl Reduction<u64> for Max
Source§const COMMUTATIVE: bool = true
const COMMUTATIVE: bool = true
Whether disjoint subsequences may be merged in any order.
Source§type Total = u64
type Total = u64
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() -> u64
fn unit() -> u64
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: u64, b: u64) -> (u64, bool)
fn merge(a: u64, b: u64) -> (u64, bool)
The folds of two neighbouring runs of items combined into the fold of both, and whether it fits.
Source§fn slice(x: &[u64]) -> (u64, bool)
fn slice(x: &[u64]) -> (u64, 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: &[u64], start: Option<u64>, out: &mut Vec<u64>) -> bool
fn scan(x: &[u64], start: Option<u64>, out: &mut Vec<u64>) -> 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 rows(data: &[u64], columns: usize, out: &mut [u64]) -> bool
fn rows(data: &[u64], columns: usize, out: &mut [u64]) -> 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 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 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.Auto Trait Implementations§
impl Forget for Max
impl Freeze for Max
impl RefUnwindSafe for Max
impl Send for Max
impl Sync for Max
impl Unpin for Max
impl UnsafeUnpin for Max
impl UnwindSafe for Max
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