Simulate gravitational N-body dynamics on the GPU. Build the naive all-pairs force kernel, tile it with shared memory, implement leapfrog time integration, and track energy conservation.
// PREREQUISITES
// PROJECT PHASES
Data layout and force kernel
AoS vs SoA layout. Write naive all-pairs force kernel.
Shared memory tiling
Load TILE bodies at a time into shared memory.
Leapfrog integrator
Symplectic velocity-Verlet time integration.
Energy conservation check
Verify KE+PE is conserved across timesteps.
// SANDBOX
GPU execution// EXPECTED OUTPUT
Step 0: E = -1234.56 (baseline) Step 100: E = -1234.59 (drift: 0.02%)
// YOUR PROGRESS
Log in to save progress
// DETAILS
// MORE IN ALGORITHMS
// LEARN THE THEORY
Algorithms concepts