News for hackers. Stuff that matters.
Re:Sorting with GPUs: A Survey by gnarbarian on Monday September 11, 2017 @01:49PM (#15220496)
I'm using GPU.js for a nbody gravity simulation in three.js. So far I'm liking GPU.js but it has it's limitations. only being able to return a single float from any function causes a lot of redundancy. For example, in order to get the 3d acceleration vector for one body I have to call the function once for each dimension, recomputing all of the temporary variables each pass. Then I have to make another pass for collision detection so it ends up being about 4n^2 vs just n^2

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

Re:Sorting with GPUs: A Survey by Zelizz on Monday September 11, 2017 @08:58PM (#15223912)
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.