sph.c file
NEON neighbor loops for the SPH density sum and pressure gradient.
Same kernels as the scalar path: cubic spline and Wendland C2, support (r < 2h), normalized. Neighbors are processed 4-wide (f32) or 2-wide (f64). No hardware gather; indices are loaded scalar then packed into a vector. The scalar functions stay the fallback.
Functions
-
static auto hsum(const vm_
vec v) -> vm_ float_ t -
static auto any_le(const vm_
vec v, const vm_ float_ t s) -> int -
static auto gather_f(const vm_
float_ t* base, const int* idx) -> vm_ vec -
static auto sigma_of(const int dim,
const int kernel) -> vm_
float_ t -
static auto shape_f(const vm_
vec q, const int kernel) -> vm_ vec -
static auto shape_df(const vm_
vec q, const int kernel) -> vm_ vec -
auto vm_sph_density_neon(const vm_
float_ t* x, const vm_ float_ t* y, const vm_ float_ t* z, const vm_ float_ t* m, const int i, const int* neighbors, const int nn, const vm_ float_ t h, const int dim, const int kernel) -> vm_ float_ t -
auto vm_sph_pressure_grad_neon(vm_
float_ t* gx, vm_ float_ t* gy, vm_ float_ t* gz, const vm_ float_ t* x, const vm_ float_ t* y, const vm_ float_ t* z, const vm_ float_ t* m, const vm_ float_ t* rho, const vm_ float_ t* p, const int i, const int* neighbors, const int nn, const vm_ float_ t h, const int dim, const int kernel) -> bool