I'm making simulations like Ant colony simulation, boids, and cellular automata in Go (to learn Go), but I believe this can apply to most languages.
From what I've read (this), using 1D arrays is generally better, but the post only addresses CPU processing. I want to do my simulations with the GPU and that may have some implications I'm not aware of.
In my case, a Map
object is a 2D array of Cell
objects.
struct Cell {...}
struct Map {
Cell[][] cells;
}
Is it better to use 1D arrays instead of multi-dimensionals when working with the GPU?