3 ms·
ISPC has some support for this using the "soa<>" qualifier. For example, struct Point { float x, y, z; }; soa<8> Point pts[...]; for (int i = 0; i < 8; +
by wahern 5y ago
ISPC has some support for this using the "soa<>" qualifier. For example,
struct Point { float x, y, z; };
soa<8> Point pts[...];
for (int i = 0; i < 8; ++i) {
pts[i].x + pts[i].y
}
behaves as if originally written like
struct Point { float x[8], y[8], z[8]; };
Point pts;
for (int i = 0; i < 8; ++i) {
pts.x[i] + pts.y[i];
}
See https://ispc.github.io/ispc.html#structure-of-array-types https://ispc.github.io/ispc.html#structure-of-array-types
I've not yet had an excuse to use ISPC myself, unfortunately :(