3 ms·
My guess it’s their deliberate design decision. It could be that most users of the library don’t care about small things. About the template stuff, I think the
by Const-me 5y ago
My guess it’s their deliberate design decision. It could be that most users of the library don’t care about small things.
About the template stuff, I think their main performance advantage over traditional BLAS is not even SIMD, it’s lazy evaluation. Expressions like x=a*b+c never compute the complete a*b matrix or vector. The a*b expression returns a small placeholder object on the stack, of a scary type with couple lines of template arguments in the type name. This way the complete expression runs without making temporary matrices, instead it streams data from all 3 arguments and only writes to memory once. And if the `x` is of the correct size already, it doesn’t call malloc/free.
- bee_rider 5y agoYeah, lazy evaluation/fusing operations is I think their best feature. Fixed interface BLAS has really good performance, but I mean, something as simple as DAXPBY is an extension. Selecting what functionality to super-optimize is hard for a fixed interface, and involves non-technical stuff like figuring out what subroutines people actually want. I'm sure someone has already looked at this, but I wonder if Eigen can just somehow nab kernels directly from BLIS, haha.
- liquidify 5y agoThis is called "expression templates" https://en.wikipedia.org/wiki/Expression_templates https://en.wikipedia.org/wiki/Expression_templates