Files
263-0007-00L-Advanced-Syste…/docs/optimization_float_inlining_SoA_symmetry.md
T
salijagic 46ded05a72 Symmetry
2026-05-27 09:33:36 +02:00

61 lines
2.1 KiB
Markdown

# Optimization: SoA (float version)
- **Author**: Smail
- **Predecessor**: variant_float_inlining_SoA.cpp
- **File(s)**: variants/variant_float_inlining_SoA_symmetry.cpp
- **Status**: TBD
## What this changes
Implemented a LUT for calculating the distances since they are symmetric. Saves n_p/2 sqrt
## Code (relevant snippet)
See `variants/variant_float_inlining_SoA.cpp`.
## Benchmark
Conditions: min of N runs (TBD), N_ITER=1000, -O3 -march=native -flto.
Diff is vs `variant_float_inlining`.
### x86
**Machine**: TBD
**Frequency**: TBD
| N | W(n) [Flops] | T(n) [Cycles] | Performance [Flops/Cycle] | Diff vs Predecessor |
| ---- | ------------ | ------------- | ------------------------- | ------------------- |
| 50 | | | | |
| 100 | | | | |
| 200 | | | | |
| 500 | | | | |
### ARM (Apple)
**Machine**: TBD
**Frequency**: TBD
| N | W(n) [Flops] | T(n) [Cycles] | Performance [Flops/Cycle] | Diff vs Predecessor |
| ---- | ------------ | ------------- | ------------------------- | ------------------- |
| 50 | | | | |
| 100 | | | | |
| 200 | | | | |
| 500 | | | | |
## Analysis
Layout change only, so the expectation is roughly no win on its own. The
float scalar loop already auto-vectorises in pieces with `-O3
-march=native`, so SoA doesnt buy much over what the AoS version was
already doing. The real payoff lands in the AVX2 child.
Verify passes against `baseline_float_n60_i500.csv` (from
`variant_float_baseline`) at the 1cm tolerance.
## Takeaway
Setup step for the AVX2 variant.