Skip to content

MKL matrix-matrix multiplication issue

Submitted by dvi..@..il.com

Assigned to Nobody

Link to original bugzilla bug (#573)
Version: 3.2
Operating system: Windows

Description

This issue arises when using eigen with MKL on a 64-bit windows system (with both the intel and the microsoft compiler).

When I create mapped matrix objects and multiple them, MKL reports an error: Parameter 8 invalid on entry to DGEMM.

I realized that this was happening because the parameters lda,ldb,ldc are set to lhsStride,rhsStride and resStride, which have garbage values when mapped matrices are used. I was able to fix it by changing lines 87-89 in GeneralMatrixMatrix_MKL.h to the following:

lda = (transa=='N')? ((m>1)?m:1) : ((k>1)?k:1) /(MKL_INT)lhsStride/; \
ldb = (transb=='N')? ((k>1)?k:1) : ((n>1)?n:1)/(MKL_INT)rhsStride/; \
ldc = (m>1)?m:1/(MKL_INT)resStride/; \

The comments have the original statements. Of course, this assumes a default unit stride, so it is not an appropriate fix.

Also, in the file Assign_MKL.h, line 213 should be #ifndef, not #ifdef, otherwise, eigen fails to compile.

Blocking

#387 (closed)

Edited by Eigen Bugzilla