sph.c file
AVX2 neighbor loops for density, pressure gradient, and artificial viscosity.
Same kernels as the scalar path: cubic spline and Wendland C2, support (r < 2h), normalized. Neighbors are gathered 8-wide (f32) or 4-wide (f64). The scalar functions stay the fallback.
Functions
-
static auto hsum(const vm_
vec v) -> vm_ float_ t -
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_avx2(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_avx2(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 -
auto vm_sph_forces_avx2(vm_
float_ t* gx, vm_ float_ t* gy, vm_ float_ t* gz, vm_ float_ t* ax, vm_ float_ t* ay, vm_ float_ t* az, const vm_ float_ t* x, const vm_ float_ t* y, const vm_ float_ t* z, const vm_ float_ t* vx, const vm_ float_ t* vy, const vm_ float_ t* vz, const vm_ float_ t* m, const vm_ float_ t* rho, const vm_ float_ t* p, const vm_ float_ t* c, const int i, const int* neighbors, const int nn, const vm_ float_ t h, const vm_ float_ t alpha, const vm_ float_ t beta, const vm_ float_ t eta, const int dim, const int kernel) -> bool -
auto vm_sph_artvisc_avx2(vm_
float_ t* ax, vm_ float_ t* ay, vm_ float_ t* az, const vm_ float_ t* x, const vm_ float_ t* y, const vm_ float_ t* z, const vm_ float_ t* vx, const vm_ float_ t* vy, const vm_ float_ t* vz, const vm_ float_ t* m, const vm_ float_ t* rho, const vm_ float_ t* c, const int i, const int* neighbors, const int nn, const vm_ float_ t h, const vm_ float_ t alpha, const vm_ float_ t beta, const vm_ float_ t eta, const int dim, const int kernel) -> bool