Skip to main content

SIMDMinMax

Trait SIMDMinMax 

Source
pub trait SIMDMinMax: Sized {
    // Required methods
    fn min_simd(self, rhs: Self) -> Self;
    fn max_simd(self, rhs: Self) -> Self;

    // Provided methods
    fn min_simd_standard(self, rhs: Self) -> Self { ... }
    fn max_simd_standard(self, rhs: Self) -> Self { ... }
}
Expand description

Efficiently retrieve the pairwise minimum or maximum for the two arguments.

Each function comes in two flavors:

  • Standard (suffixed): Compute the minimum or maximum in a way that is equivalent to Rust’s built-in minimum or maximum functions.

    When the scalar type is integral, the behavior is unambiguous.

    When the scalar type is a floating point and one value of a pair is NaN, the other value is returned. When the result is zero, either a positive or a negative zero can be returned.

  • Fast (unsuffixed): Compute the minimum or maximum using the fastest possible method on the given architecture with non-standard NaN handling.

    When the scalar type is integral, the behavior is the same as the standard implementations.

    When the scalar type is a floating point, the implementation is allowed to differ with respect to NaN handling. That is, when one of the arguments is NaN, the implementation is allowed to return either the other argument (like the standard implementation) or NaN. Like the standard implementation, if the result is zero, then a zero of either sign can be returned.

    This method should be preferred when precise NaN handling is not needed as it can be more efficient.

Required Methods§

Source

fn min_simd(self, rhs: Self) -> Self

Return the pairwise minimum of self and rhs, subject to looser NaN handling.

Source

fn max_simd(self, rhs: Self) -> Self

Return the pairwise maximum of self and rhs, subject to looser NaN handling.

Provided Methods§

Source

fn min_simd_standard(self, rhs: Self) -> Self

Return the pairwise minimum of self and rhs as if by applying the standard library’s min method for the scalar type.

Source

fn max_simd_standard(self, rhs: Self) -> Self

Return the pairwise maximum of self and rhs as if by applying the standard library’s max method for the scalar type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl SIMDMinMax for diskann_wide::arch::x86_64::v3::f32x4_::f32x4

Source§

impl SIMDMinMax for diskann_wide::arch::x86_64::v3::f32x8_::f32x8

Source§

impl SIMDMinMax for diskann_wide::arch::x86_64::v4::f32x4_::f32x4

Source§

impl SIMDMinMax for diskann_wide::arch::x86_64::v4::f32x8_::f32x8

Source§

impl SIMDMinMax for f32x16

Source§

impl<T, const N: usize, A> SIMDMinMax for Emulated<T, N, A>
where T: ReferenceScalarOps,

MinMax