Dynamic Jagged Arrays on the GPU

129 views Asked by At

I have a an array of arrays in which each array is of a different size. This is all stored in GPU memory, so it is compacted into a one dimensional array. I need each independent array to be able to re-size independently without touching (read -> move -> write) any of the other data. For example, when one of the inner arrays needs to grow, I could remove the data, compact the remaining data, and place the new, larger array at the end of the jagged array. However, as the jagged array contains a lot of data, this would be extremely inefficient. Empty spaces can exist, but due to the nature of the application, the max amount of GPU memory would quickly be reached if I only added to the end.

I have a fallback option where I would insert new arrays into available spaces if they fit perfectly, but this would require a second write on empty data to remove useless information, something that I would preferably like to avoid as it would also involve a serial algorithm in a parallel environment.

If anyone has solution, or even a topic that I could research more into, I would appreciate it immensely.

0

There are 0 answers