| > I think a legitimate criticism is that it is unclear who std::simd is for. People that don’t use SIMD today are unlikely to use std::simd tomorrow. At the same time, this does nothing for people that use SIMD for serious work. Who is expected to use this? There is plenty of vectorization that are simple enough to be done with std::simd today and that will still bring any autovectorizer begging on its knees for various reasons. As an anecdote, I currently got a 8x speedup with std::simd (AVX2 & SVE2) on a rather trivial parser of mine recently that autovectorizer failed miserably to do properly. Would I have get better result using intrinsics ? Likely, yes. Did I want to suffer the maintainability and portability pain associated with it for a simple parser ? Certainly not. For these use case, std.simd does the job.
And will probably do a better and wider job with time when it get enriched by the committee. The blog brings some valid criticism but really looks like a flame war trying to destroy an already opened door. (1) Is there more performant solutions that std::simd for vectorization ? Yes, of course.
The STL evolves slow, its main goal is to provide a generic and portable implementations of a set of algorithms. Not to provide the best implementation in existence. The best implementation of most algorithms (including SIMD patterns) evolves every 6 month, you can not expect a standard library with 3 different implementation to keep up with that. (2) Is the future of vectorization ISPC ? Nope. ISPC has been around for > 10y and is still niche.
There is very good reasons to that: Yes it can generate better code but in most use case, adding a massive dependency of a compiler + an arbitrary LLVM version + a DSL on your project is not worth it. Specially considering that it is an Intel project and that Intel (almost) abandonned the project multiple time (In pure Intel fashion). So yes, criticism is easy, and yes std::simd is full of problems. But I am glad it exists, and thanks to the people that made it happen... Because it is useful, even in the current state. |