Hello everyone,
I have a question about building a structure for space partition.
I’ve read it’s faster to build tree structures on CPU than on GPU.
But what’s about grids? In the CUDA sample code “particles” a grid
structure is completely build on GPU.
My real problem is:
I have a very large array of particles. This number of particles is too big to load all of them on GPU simultaneously.
So I separate this large array in smaller ones.
These small arrays can be then loaded to GPU sequentially for doing calculations.
I want to split the particles in smaller arrays respectively their location in space,
therfore I need the particles ordered in a space partition structure, e.g. a grid,
BEFORE the particles are loaded on GPU.
I thought of two different possibilities:
- I do the structure building on CPU for all particles and then split this new, ordered array in smaller ones for GPU. This could be very slow for very many particles, couldn’t it?
- I build the structure on GPU by running it sequentially for parts of the large particle array. Every iteration I would have to copy the ordered particles from GPU on CPU. (expensive GPU-CPU transfer??)
At the end I would have many ordered particle arrays on CPU which I had to
combine to one large array again. Then I could separate this array in smaller ones
in respect of the space partition.
Possibility 2 sounds more sophisticated… Which method is faster?
What do you think?