2 ms·
This sounds like a great idea. I went with this approach because I'm new to SIMD, so I aped the most promising API (core::simd), extending it naturally. I need
by the__alchemist 2y ago
This sounds like a great idea. I went with this approach because I'm new to SIMD, so I aped the most promising API (core::simd), extending it naturally.
I need to think through the consequences. It might involve feature gates, and/or an enum. So, for example, instead of:
pub struct f32x8(__m256);
It might be this internally, with some method to auto-choose variant based on system capability?:
pub enum f32_simd {
X8(__m256),
X16(__m512),
}
etc. Thoughts?
- camel-cdr 2y agoI'm not proficient in Rust, but API wise I'd conceptually define types like f32xn or f32s, which have the number of elements that fit into a vector register for your target architecture, so 4 for NEON/SSE, 8 for AVX and 16 for AVX512. I can recommens lookig at the highway library: https://github.com/google/highway https://github.com/google/highway