Why not calculate the unchanging intermediate results in separate functions so that you can pass them as arguments to the final function?
Re:Sorting with GPUs: A Survey
by gnarbarian on Monday September 11, 2017 @11:06PM
(#15224503)
Easier said than done. I can't get superkernels to work at all. I've tried.
nonetheless it's still about an order of magnitude faster than the pure CPU implementation I have.
In the future they plan to add webGL 2.0 and OpenCL support which should improve the flexibility of the library.
http://thedagda.co:9000/?stars=true&bodyCount=1000
you can toggle CPU nbody computation with:
?CPU=true in the url. remove it for GPU computation.
you can toggle the number of planets with the bodyCount variable. default is 1000
if you have a beefy computer try bodyCount=4000
gamepad=true works if you have a xbox controller hooked up.
on gitHub:
https://github.com/ubernaut/spaceSim