pub struct LInfNorm;Expand description
Evaluate the LInf norm of the argument.
§Implementation
Closed implementation: Supported input types: f32, Half. f32 path: simple scalar loop using abs and max. Half path: widens each element with ‘diskann_wide::cast_f16_to_f32’ then applies abs and max.
§Performance
The Half widening (cast_f16_to_f32) is per element and does not auto-vectorize well, so LInfNorm on large Half slices may become a throughput bottleneck compared to an explicit SIMD reduction (e.g. loading f16x8, converting once, then doing lane-wise abs & max in f32). Callers with large Half inputs should be aware of the potential bottleneck.
Current behavior is correct but potentially slower than expected for large Half slices.
Trait Implementations§
impl Copy for LInfNorm
Auto Trait Implementations§
impl Freeze for LInfNorm
impl RefUnwindSafe for LInfNorm
impl Send for LInfNorm
impl Sync for LInfNorm
impl Unpin for LInfNorm
impl UnwindSafe for LInfNorm
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