A simple gravitational N-body simulation in less than 100 lines of C code, with CUDA optimizations.
A simple gravitational N-body simulation in less than 100 lines of C code, with CUDA optimizations.
There are 5 different benchmarks provided for CUDA and MIC platforms.
nbody.c : simple, unoptimized OpenMP C code timer.h : simple cross-OS timing code
Each directory below includes scripts for building and running a "shmoo" of five successive optimizations of the code over a range of data sizes from 1024 to 524,288 bodies.
cuda/ : folder containing CUDA optimized versions of the original C code (in order of performance on Tesla K20c GPU)
mic/ : folder containing Intel Xeon Phi (MIC) optimized versions of the original C code (in order of performance on Xeon Phi 7110P)