An array of structures stores records one after another, with each record holding several related fields. For particles, each record might contain position (x, y, z) and velocity (vx, vy, vz). section 10.9
struct Particle {
float x, y, z; #A
float vx, vy, vz; #B
};
Particle particles[N]; #CA particle structure shows how six fields are grouped into each record before the records are placed in an array. section 10.9
This layout is intuitive, but GPU threads reading the same field from consecutive particles jump between records. With six floats per particle, neighboring threads’ x values are six floats apart, making access strided rather than coalesced. A structure of arrays (SoA) instead puts each field in its own contiguous array, which can be faster when a kernel reads only one or two fields. section 10.9 section 10.14
Updating particle positions
A kernel that updates x, y, and z using the corresponding velocities accesses several fields per particle. Whether AoS or SoA performs better depends on the fields the kernel reads; SoA can be 3–5× faster for memory-bound kernels that read only one or two fields per element. section 10.9

