views:

107

answers:

2

Is there an equivalent of dgemm (from BLAS) for integral types? I only know of dgemm, sgemm for double precision / single precision matrices, but would like to have it for matrices that are of integral type such as int (or short int...).

Note: I'm not looking for a solution that involves converting to float/double, and am looking for a fast library implementation.

Also, same question for dgemms (using strassen algorithm).

+1  A: 

BLAS algorithms don't natively support integer types.

Paul
That's what I suspected, but is there any other library to do this? Even a naive implementation on unisgned chars without overflow checking is ~10 times slower than dgemm using doubles. I'd hope there would be a way to 1) avoid memory+time bottleneck involved in converting to intermediate floating point types.
spirov
Paul
+1  A: 

You did not specify a programming language. In C++, you could interface with a matrix library such as Eigen (disclaimer: I'm associated with this project). Eigen uses vectorization so it should be pretty fast - make sure you enable vectorization - but I didn't do any experiments so I'm not sure. There are some complicated alignment issues that may be a problem for you, but I'm not familiar with them.

This SO question discusses various C++ matrix libraries, mainly in the context of computer graphics.

Jitse Niesen