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§
Provided Methods§
Sourcefn min_simd_standard(self, rhs: Self) -> Self
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.
Sourcefn max_simd_standard(self, rhs: Self) -> Self
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§
impl SIMDMinMax for diskann_wide::arch::x86_64::v3::f32x4_::f32x4
impl SIMDMinMax for diskann_wide::arch::x86_64::v3::f32x8_::f32x8
impl SIMDMinMax for diskann_wide::arch::x86_64::v4::f32x4_::f32x4
impl SIMDMinMax for diskann_wide::arch::x86_64::v4::f32x8_::f32x8
impl SIMDMinMax for f32x16
impl<T, const N: usize, A> SIMDMinMax for Emulated<T, N, A>where
T: ReferenceScalarOps,
MinMax