Expand description
SIMD-accelerated math kernels for batch vector and particle operations.
This module provides Structure-of-Arrays (SoA) layouts and batch operations optimized for CPU cache locality and auto-vectorization. The batch operations process multiple elements at once, enabling the compiler to emit SIMD instructions on supported platforms.
§Layout
Instead of the traditional Array-of-Structures (AoS) layout:
[x0,y0,z0, x1,y1,z1, x2,y2,z2, ...]We use Structure-of-Arrays (SoA):
xs: [x0, x1, x2, ...]
ys: [y0, y1, y2, ...]
zs: [z0, z1, z2, ...]This layout allows the compiler to vectorize operations across contiguous memory, improving throughput for large batches.
Structs§
- Vec3
Batch - Structure-of-Arrays layout for batch Vec3 operations.
Enums§
- Simd
Math Error - Errors that can occur in SIMD batch operations.
Functions§
- accumulate_
forces_ batch - Accumulate forces onto a mutable force batch.
- compute_
distances_ batch - Compute distances from a single reference point to many positions.
- cubic_
spline_ kernel_ batch - Evaluate the cubic spline kernel (M4 kernel) for a batch of distances.