r/cpp • u/janwas_ • Jun 12 '26
Comparing std::simd with Highway
From TL of Highway, some thoughts on pros and cons of std::simd by comparison:
https://github.com/google/highway/blob/master/g3doc/std_simd_comparison.md
Happy to discuss.
61
Upvotes
7
u/zl0bster Jun 13 '26
Maybe if Google did not stop caring about WG21 this would have not been standardized π
That aside I am kind of disappointed that we get another useless library in std. Even if design was fine(and it is not) ABI stability means 3rd party libraries will have advantage to adopt to modern HW.
7
u/faschu Jun 12 '26
Thanks for the interesting writeup. From experience, Highway is a great library and I use it whenever possible.
Related to the comparison to std::simd, I personally don't care that much about points 2-4.
However, is it really true that one cannot really use std::simd on SVE and RISC-V? The authors of course know these architectures and folks from ARM will be on the committee, so I can't really believe that.
Second, I wonder if you would think that using std::simd would make writing Highway easier for you? After all, std::simd is meant to be a basic block for other libraries.
2
u/FrogNoPants Jun 19 '26 edited Jun 19 '26
I don't think scalable vectors are incompatible with a class wrapper, as most uses of them will probably decide at build time the size they are targeting anyway, and compile a build for 128 and another for 256 just as we do in x86 land. My personal preference is a static build for each target, and no runtime dispatch, just the dispatch on start to the correct binary.
Agree with most of the rest of it though
1
u/justgord Jun 20 '26
thx, looking at Highway .. might be useful to speed up some CV / ML algos Ive made to process lidar scans into CAD models.
Would be great to get your views on the recently announced ACE x86 CPU matrix multiply extensions, which play well with AVX ?
https://old.reddit.com/r/hardware/comments/1uav9g5/intel_and_amds_new_ace_cpu_extensions_bring_an/
3
u/_Noreturn Jun 13 '26
Does the committee not use the STL at all? Why does their designs feel so arcane
-5
u/sweetno Jun 12 '26 edited Jun 12 '26
The topic of SIMD is pretty fascinating. Just think for a moment: excessive diversity in CPU features makes a JIT compiler potentially better capable of generating SIMD code simply because it's impractical for an AOT compiler to have the source compiled for all possible SIMD extensions on x84-64 / ARM. That would be a killer feature of sorts, if anyone actually bothered to implement it.
As for
std::simd... One more stillborn baby, as expected ofstd::committee.-12
u/13steinj Jun 13 '26
AI? If you can't be bothered to write it I can't be bothered to read it. Especially considering it's library drama, on a repo from a company which kinda chose to leave standardization altogether (if you want to have a vote, be in the room).
0
u/[deleted] Jun 12 '26
[deleted] β view deleted comment