After some days of hard work, I finally made OpenCL work. For now it's a straight port of gravity nbody simulation, involving O(0.5N²) complexité. I'll see later to compute complex data structure to implement Barnes-Hut quadtree algorithm.
The gain is really impressive, at least a factor 3 with a GForce 285 GTX compared to a quadcore Intel 3.2Ghz. There's much room to improve in my implementation, but first of all I'll concentrate on improving my OpenCL class, to have something very small, with the fewest calls possible.
I can't wait to implement SPH on GPU.
Anyway, here's the log :
~~~~~~~~~~~~~
| VIDEO LOG |
~~~~~~~~~~~~~
Number of particles : 20000
Max tree depth : 256
Gravitational approximation : 0.10
Gravity : 0.000100
Gravity smoothing : 0.100000
Lowest acceleration : 0.000000.3
Highest acceleration : 0.100000.3
Time step : 0.010s
Simulation time : 1h 11m 47s
Simulated time : 2m 30s
Video time : 30s
Playback time scale : 5.00x
Simulation factor : 0.034827
Frame per seconds : 3.5fps
@anujkaliaiitd thank you. particles' position and velocity are set by the program, you just have to define where the center of each galaxy lies, and their radii, and particles are computed accordingly.
VelRyphon 7 months ago
hi!
this is impressive...i've implemented n-body simulation on a virtex6 FPGA.
where did you get the particle data from? or did you generate it yourself?
anujkaliaiitd 7 months ago