Skip to content

Add SIMD-accelerated density update for DensityEpsi!#168

Open
AhmedSalih3d wants to merge 1 commit intomainfrom
codex/evaluate-simd.jl-for-performance-improvements
Open

Add SIMD-accelerated density update for DensityEpsi!#168
AhmedSalih3d wants to merge 1 commit intomainfrom
codex/evaluate-simd.jl-for-performance-improvements

Conversation

@AhmedSalih3d
Copy link
Owner

Motivation

  • Speed up the per-particle density adjustment in the symplectic time stepping path by vectorizing the loop with SIMD operations.
  • Add SIMD.jl as a direct dependency to enable portable explicit SIMD intrinsics.

Description

  • Replaced the scalar loop in DensityEpsi! with a call to a new _density_epsi_simd! helper that uses SIMD.Vec, vload and vstore! and falls back to a scalar tail loop.
  • Added using SIMD to src/SimulationEquations.jl and implemented lane selection based on eltype(Density) (8 lanes for Float32, 4 otherwise).
  • Updated Project.toml to add SIMD to [deps] and [compat] and produced a resolved Manifest.toml during Pkg.resolve/Pkg.instantiate.
  • DensityEpsi! now returns Density after the SIMD update helper completes.

Testing

  • Ran julia --project=. -e 'using Pkg; Pkg.resolve()', julia --project=. -e 'using Pkg; Pkg.instantiate()' and julia --project=. -e 'using Pkg; Pkg.test()' to validate dependency resolution, instantiation and tests.
  • Pkg.resolve() emitted a registry download 403 warning in this environment but SIMD was installed and the manifest was updated successfully.
  • Test results: the package precompiled and SPHExample tests passed (time stepping and isolated particle tests completed successfully).
  • No automated test failures were observed after the change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant