Matrix : joined ops - blas #2757
Replies: 3 comments 4 replies
-
BLAS usually doesn't get you much for dot products. Although depends how big they are. But yeah, some overload for |
Beta Was this translation helpful? Give feedback.
-
By the way, replacing:
with
in
That's a 40% improvement. That's using a trick from Chandler Carruth talk at CppCon. |
Beta Was this translation helpful? Give feedback.
-
I've added Update code:
I've compiled the above with
Fundamentally, I don't understand why dot products on |
Beta Was this translation helpful? Give feedback.
-
In dlib's expression template suite, there isn't an overload of
operator*
for joined matrices.This could be an optimization when performing dot products with circular buffers for example, which are essentially two joined arrays. The optimization would be to split the dot product into a sum of two dot products. You could then use a BLAS routine. At the moment this isn't possible.
Here is some example code:
Also, for whatever reason, when using
dlib::circular_buffer
directly, it's nearly 10X slower...Here is the output on my machine:
Note, I have assert statements disabled and MKL enabled. Even so, BLAS functions aren't used anywhere above.
Beta Was this translation helpful? Give feedback.
All reactions