问题
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:
BLAS algorithms don't natively support integer types.
回答2:
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.
来源:https://stackoverflow.com/questions/1830118/matrix-multiplication-for-integral-types-using-blas