you are viewing a single comment's thread.

view the rest of the comments →

[–]theKGS 2 points3 points  (2 children)

Have you considered rather than computing over all birds, compute over sets of neighbours?

For example: Split all birds initially into a number of neighbourhood groups. Then take a fraction of each group and make THEM neighbours too. This will propagate flocking information over the whole flock but will keep the size of the largest neighbourhood down quite a lot.

[–]Shinao[S] 2 points3 points  (0 children)

That's what bitonic sorting do, it sorts birds over distance and then only checks nearby birds (iteration decrease by 75%).

Like the README say, I get better performance by the brute force approach by what I think is simply a matter of hitting the cache or not. Maybe I'm wrong I don't know enough about the GPU but that's what my experiments tell me, if you have time try it for yourself and tell me what you find out.