Numerical computing and tensor library for Rust, in the role of NumPy: n-dimensional arrays, linear algebra, FFT, statistics and autograd on CPU, CUDA and WebGPU
//! Original-value classification for exceptional SIMD max reductions.
usecrate::dtype::Element;/// Scan only exceptional maxima so SIMD max NaN suppression cannot hide masked NaNs.
#[inline]pub(super)unsafefnoriginal_row_limit<T: Element>(base:*const T, len:usize)->Option<T>{letmut all_negative_infinity =true;letmut any_nan =false;for i in0..len {let value =(*base.add(i)).to_f64();
all_negative_infinity &= value ==f64::NEG_INFINITY;
any_nan |= value.is_nan();}if all_negative_infinity {Some(T::from_f64(f64::NEG_INFINITY))}elseif any_nan {Some(T::from_f64(f64::NAN))}else{None}}