5

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).

this. __curious_geek
  • 40,897
  • 20
  • 108
  • 134
spirov
  • 231
  • 3
  • 6

2 Answers2

3

BLAS algorithms don't natively support integer types.

Paul
  • 5,308
  • 1
  • 17
  • 18
  • 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 Dec 02 '09 at 02:53
  • 1
    http://portal.acm.org/citation.cfm?id=1073899&dl=GUIDE&coll=GUIDE&CFID=64924169&CFTOKEN=87018353 This is a link to some research published by acm on exact linear algebra for blas. You might query the authors on how to get the libraries they developed. – Paul Dec 03 '09 at 18:43
3

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.

Community
  • 1
  • 1
Jitse Niesen
  • 4,292
  • 22
  • 22