Re:Major Update of Vector Class Library
by jey on Monday August 05, 2019 @11:00AM
(#20614712)
From the docs:
(Tldr: this is for CPU vectors and isn't directly comparable to a linear algebra library like Eigen.)
[ Parent
| on HN ]
Re:Major Update of Vector Class Library
by throwaway542134 on Monday August 05, 2019 @01:27PM
(#20616100)
> ∙ CPU dispatching to utilize higher instruction sets when available
What's the advantage of hand rolled CPU dispatching over compiler intrinsincs like function multiversioning in GCC/Clang?
FMV is pretty neat but there are scenarios where it's not ideal, so I'm not surprised to see it not used in what is meant to be a lightweight high performance library.
Notably the fact that the dispatching is done at runtime means you are trading off the convenience factor for code size and running extraneous dispatching code in your critical path. Additionally I've anecdotally seen on modern Intel hardware the power heuristics can penalize you for even _speculatively_ running some of the wider instruction sets.
Re:Major Update of Vector Class Library
by throwaway542134 on Monday August 05, 2019 @02:53PM
(#20617264)
Am I missing something? The CPU dispatching in this library is done at runtime too... I thought FMV only has a penalty on the first call?
Ah apologies, I only took a cursory look at his dispatching logic. It looks to me like it supports both modes, but you have to hand roll the dispatching logic if you want to use it at runtime (but he provides an example). If you _really_ need the runtime dispatch then yeah I'd agree FMV is probably cleaner.