Commit f7d2406
feat(hpc/reductions): SIMD-dispatched sum/mean/max/min/argmax/nrm2 (#122, sprint A10)
* feat(hpc): add SIMD reductions dispatcher (sum/mean/max/min/argmax/argmin/nrm2)
* fix(reductions): mean_f32/f64 return Option per A10 spec
Spec for sprint A10 calls for:
pub fn mean_f32(s: &[f32]) -> Option<f32>; // None on empty
Previously mean_f32/mean_f64 panicked on empty input. This change
returns None for empty slices, matching argmax_f32 / max_f32 / min_f32
which already use the Option convention.
Tests:
- mean_f32_empty_is_none — verifies None on empty input
- mean_f64_empty_is_none — verifies None on empty input
- mean_f32_basic — non-empty case via .expect()
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2aaa90a commit f7d2406
2 files changed
Lines changed: 617 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
0 commit comments