3 ms·
A perspective on abstracting SIMD that emphasizes how to expose intrinsics seems like its lost in the weeds. Is there anything like ISPC for Rust? One of the cr
by wahern 1y ago
A perspective on abstracting SIMD that emphasizes how to expose intrinsics seems like its lost in the weeds. Is there anything like ISPC for Rust? One of the critical features of ISPC is language support for transforming arrays-of-structs (AoS) to structs-of-arrays (SoA). You can define, declare, and reference your data structures as you normally would, e.g.
struct { float x, y, x } arr[100]
which is easier to grok and maintain, but the internal memory layout transparently becomes more like
struct { x[100], y[100], x[100] } arr
See https://ispc.github.io/ispc.html#structure-of-array-types https://ispc.github.io/ispc.html#structure-of-array-types.
When such semantics are provided by the language itself, the need to resort to explicit SIMD intrinsics (directly or indirectly via API abstractions) is tremendously reduced as most of the biggest impediments to auto-vectorization are lifted. ISPC also provides complementing language features for managing parallel control flow, e.g. conditional masking, that significantly obviates much of the remaining use cases for explicit SIMD procedures.
- camel-cdr 1y agoSince you can trivially build a SoA container type with C++ templates, I assume the same is possible in Rust.