3 ms·
Compilers are becoming reasonably good at autovectorization if you’re a bit careful how you write your code. I wouldn’t say that simd is niche. You often don’t
by adrianN 2y ago
Compilers are becoming reasonably good at autovectorization if you’re a bit careful how you write your code. I wouldn’t say that simd is niche. You often don’t get the really great improvements you can achieve by being clever manually, but the improvements are still very measurable in my experience.
- secondcoming 2y agoclang may be getting better, but gcc isn't. Being 'careful how you write your code' is putting it mildly. IME you have to hold the compiler's hand at every step. Using 'bool' instead of 'int' can make gcc give up on autovectorisation, for example. You need to use intrinsics, or a wrapper lib around them, if you want to be sure that SIMD is being used.
- cvadict 2y agoIMHO, the overhead of perpetually babysitting compiler diagnostics or performance metrics to ensure your latest update didn't confound the auto-vectorizer is never a net positive over just using something like xsimd, Google highway, etc.
- whiterknight 2y agoThe compiler can’t fix your data layout
- titzer 2y agoIt depends on how high-level the abstraction you're using is. Things like Halide do pretty significant reorganization of your code and data to achieve parallel speedup. And of course if you are using Tensor libraries you're doing exactly that. It all depends on the level of abstraction.
- whiterknight 2y agoI assume if we talking about SIMD we are not talking about python, etc.