Skip to content

Commit d522a32

Browse files
committed
style(bench): rustfmt ewa_syrk_crossover + canonical -C target-cpu in RESULTS
Fixes CI cargo fmt --all --check (rustfmt 1.95.0: wrap the use import, normalize_quat method chain, and Spd3::new args) and the CodeRabbit nit on RESULTS.md (canonical `-C target-cpu` spelling with a space). Docs/format only; no behavior change. https://claude.ai/code/session_01HbqooFZHAjaUtFEzhA1R2u
1 parent 94b0009 commit d522a32

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

benches/RESULTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ project's deployment tier `x86-64-v4`** (AVX-512 native — `F32x16` is a
139139
single `__m512`), via the documented override:
140140

141141
```bash
142-
RUSTFLAGS="-Ctarget-cpu=x86-64-v4" \
142+
RUSTFLAGS="-C target-cpu=x86-64-v4" \
143143
cargo bench --features splat3d --bench ewa_syrk_crossover
144144
```
145145

benches/ewa_syrk_crossover.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
//! gaussian, so `J·Σ·Jᵀ` does not batch that way.
3939
4040
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
41-
use ndarray::hpc::splat3d::{project_batch, sandwich, sandwich_x16, Camera, Gaussian3D, GaussianBatch, ProjectedBatch, Spd3};
41+
use ndarray::hpc::splat3d::{
42+
project_batch, sandwich, sandwich_x16, Camera, Gaussian3D, GaussianBatch, ProjectedBatch, Spd3,
43+
};
4244

4345
const SIZES: [usize; 3] = [1_024, 100_000, 1_000_000];
4446

@@ -70,7 +72,9 @@ fn build_spd_pairs(n: usize) -> (Vec<Spd3>, Vec<Spd3>) {
7072
}
7173

7274
fn normalize_quat(q: &mut [f32; 4]) {
73-
let n = (q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]).sqrt().max(1e-12);
75+
let n = (q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3])
76+
.sqrt()
77+
.max(1e-12);
7478
for v in q.iter_mut() {
7579
*v /= n;
7680
}
@@ -96,7 +100,14 @@ fn sandwich_gemm_shape(m: &Spd3, n: &Spd3) -> Spd3 {
96100
r[i][j] = t[i][0] * a[j][0] + t[i][1] * a[j][1] + t[i][2] * a[j][2];
97101
}
98102
}
99-
Spd3::new(r[0][0], 0.5 * (r[0][1] + r[1][0]), 0.5 * (r[0][2] + r[2][0]), r[1][1], 0.5 * (r[1][2] + r[2][1]), r[2][2])
103+
Spd3::new(
104+
r[0][0],
105+
0.5 * (r[0][1] + r[1][0]),
106+
0.5 * (r[0][2] + r[2][0]),
107+
r[1][1],
108+
0.5 * (r[1][2] + r[2][1]),
109+
r[2][2],
110+
)
100111
}
101112

102113
fn build_gaussians(n: usize) -> GaussianBatch {

0 commit comments

Comments
 (0)