Skip to content

Add optional CUDA neighbor-loop and RunSimulationCUDA#139

Open
AhmedSalih3d wants to merge 2 commits intocodex/optimize-neighborlist-code-performancefrom
codex/add-cuda-support-for-stillwedgemdbc
Open

Add optional CUDA neighbor-loop and RunSimulationCUDA#139
AhmedSalih3d wants to merge 2 commits intocodex/optimize-neighborlist-code-performancefrom
codex/add-cuda-support-for-stillwedgemdbc

Conversation

@AhmedSalih3d
Copy link
Owner

Motivation

  • Provide an optional CUDA-based execution path to accelerate the per-particle interaction loops on supported GPUs.
  • Allow the StillWedgeMDBC example to run on GPU when available while preserving a CPU fallback.
  • Keep the CUDA integration non-intrusive and opt-in so users without CUDA are unaffected.

Description

  • Add src/SPHCUDA.jl implementing a lightweight GPU path, including a CUDA neighbor-loop kernel, helpers to build neighbor cell ranges, and GPU variants of the density-diffusion and viscosity computations; export RunSimulationCUDA and CUDAAvailable.
  • Wire conditional inclusion/export into src/SPHExample.jl so the package exposes RunSimulationCUDA only when CUDA.jl is present and otherwise provides CUDAAvailable() returning false.
  • Update example/StillWedgeMDBC.jl to select RunSimulationCUDA when CUDAAvailable() is true, otherwise fall back to the existing RunSimulation; change example metadata to use SimpleMDBC to match the CUDA path expectations.
  • Document the optional CUDA workflow in README.md and add SPHCUDA.jl to the source map; the CUDA path performs runtime checks and currently supports NoShifting/NoKernelOutput configurations and a restricted set of diffusion/viscosity models.

Testing

  • Automated tests were not executed in this environment because CUDA was not available; the GPU path includes runtime checks that will error early when CUDA.functional() is false.
  • Commands used during development and review include ls, rg -n ..., sed -n '...' and nl -ba src/SPHCUDA.jl | sed -n '1,240p' to inspect files and verify the new module integration.

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