Skip to content

Add optional CUDA neighbor-list and GPU neighbor-loop utilities#134

Open
AhmedSalih3d wants to merge 8 commits intocodex/optimize-neighborlist-code-performancefrom
codex/create-cuda-implementation-for-neighborloop-and-neighborlist
Open

Add optional CUDA neighbor-list and GPU neighbor-loop utilities#134
AhmedSalih3d wants to merge 8 commits intocodex/optimize-neighborlist-code-performancefrom
codex/create-cuda-implementation-for-neighborloop-and-neighborlist

Conversation

@AhmedSalih3d
Copy link
Owner

Motivation

  • Provide a GPU-capable neighbor-list and neighbor-loop implementation so neighbor search and per-particle interaction loops can be offloaded to CUDA, with focus on NeighborLoop and neighbor-list utilities.
  • Keep the existing CPU path intact and enable incremental adoption by loading CUDA helpers only when CUDA.jl is available.

Description

  • Added src/SPHCUDANeighborList.jl which defines CUDACellGrid, CUDANeighborList, GPU buffer allocation, and CUDA kernels for computing per-particle CellIds, CellCounts, ParticleRanges, ParticleOrder, precomputing neighbor-cell indices, and the device-side neighbor loop.
  • Implemented high-level CUDA helpers: AllocateCUDANeighborList, ConstructNeighborOffsets, BuildNeighborCellListsCUDA!, UpdateNeighborsCUDA!, and NeighborLoopCUDA! to mirror the CPU neighbor-list workflow on the GPU.
  • Updated src/SPHExample.jl to conditionally include and re-export the CUDA utilities only when CUDA.jl is present (HasCUDA), preserving default CPU behaviour.
  • Documented usage and installation notes in README.md with a minimal sketch showing CUDACellGrid allocation, UpdateNeighborsCUDA!, and NeighborLoopCUDA!.

Testing

  • No automated tests were run for this 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