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.
*** Bug 589 has been marked as a duplicate of this bug. ***
For the typo see: https://bitbucket.org/eigen/eigen/commits/62ed8708b7e6711a52e9735fa7177dc91773dc2d and the backport: https://bitbucket.org/eigen/eigen/commits/62df767dbf37/ Changeset: 62df767dbf37 Branch: 3.1 User: ggael Date: 2012-08-27 13:17:45 Summary: fix a typo in commit 4b483eaddf74 (regarding MKL on windows) (transplanted from 62ed8708b7e6711a52e9735fa7177dc91773dc2d)
Now regarding the problem with strides, I don't see why the provided lhsStride values would be wrong? If that happens, then this must be fixed earlier in the code. Does it work fine without MKL?
(In reply to comment #3) > Now regarding the problem with strides, I don't see why the provided lhsStride > values would be wrong? If that happens, then this must be fixed earlier in the > code. Does it work fine without MKL? Yes, without MKL its fine.
Work for me with: #include <Eigen/Eigen> using namespace Eigen; int main() { int rows, cols, depth; rows = cols = depth = 50; double *data = new double[rows*cols+rows*depth+depth*cols]; MatrixXd::Map(data, rows, cols) += MatrixXd::Map(data+rows*cols, depth,depth).transpose() * MatrixXd::Map(data+rows*(cols+depth), depth, cols); return 0; } compiled with: icpc -mkl=sequential -DEIGEN_USE_MKL_ALL bug_573.cpp -o bug_573 -O3
For me it didn't work in linux with gcc 4.6.3 either. I had to deactivate it completely. I am using MKL 10.3 update 7. Eigen 3.1.3.
works for me with the previous example, g++ 6.3 and MKL 10.3.9. Compiled with: g++ -DEIGEN_USE_MKL_ALL bug_573.cpp -o bug_573 -O3 -I eigen-hg -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_lp64.a $MKLROOT/lib/intel64/libmkl_gnu_thread.a $MKLROOT/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -fopenmp -m64 -I$MKLROOT/include
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/573.