AoS vs SoA particle data and GPU memory coalescing #2747
-
Hi, I am reading the Particles documentation (https://amrex-codes.github.io/amrex/docs_html/Particle.html#arrays-of-structs-and-structs-of-arrays) and it looks like some data is always stored in array-of-structs form. Based on how memory coalescing works, I would have expected structs-of-arrays form to be generically more efficient. Is this not the case in practice? Or are there other reasons to store it this way? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Ben, Yes, in my experience the SoA format is generally more efficient. Originally, all particle data was stored in AoS form, and the fact the positions and ids still are is a remnant of that history. There are plans to relax this constraint this summer with @ax3l and @Thierry992. |
Beta Was this translation helpful? Give feedback.
Hi Ben,
Yes, in my experience the SoA format is generally more efficient. Originally, all particle data was stored in AoS form, and the fact the positions and ids still are is a remnant of that history. There are plans to relax this constraint this summer with @ax3l and @Thierry992.