News for hackers. Stuff that matters.
Re:The compiler will optimize that away by celrod on Sunday May 02, 2021 @04:16PM (#27018636)
ISPC also has first class support for "(array of) structure of arrays", see: https://ispc.github.io/ispc.html#structure-of-array-types

For example:

  soa<8> Point pts[...];
declares an array of struct of arrays, where each inner struct array contains 8 elements. This would have the advantage of playing well with the streaming prefetcher if you're working with all fields of the `Point` type, and allowing the compiler to use and increment a single pointer for loading/storing, accessing each field with a small compile time offset (that can get folded into addressing calculations, making them essentially free).

Julia's StructArrays package is also very convenient: https://github.com/JuliaArrays/StructArrays.jl

There are no comments on this comment yet.