714
2013-12-13 20:32:47 +0000
Dynamic size double matrix to matrix product problem when multithreading is on
2015-02-18 15:27:51 +0000
1
1
1
Unclassified
Eigen
Core - matrix products
unspecified
x86 - general
Linux
RESOLVED
FIXED
High
Wrong Result
---
1
sobhan.naderi.p
eigen.nobody
chtz
gael.guennebaud
oldest_to_newest
2942
0
sobhan.naderi.p
2013-12-13 20:32:47 +0000
I was working with dynamic size double matrices and I was compiling with openMP. I set the matrices by mapping their data array as follows:
Map<Matrix<double, Dynamic, Dynamic, RowMajor> > feature_matrix(ht, cnt_features, cnt_feature_dim);
Map<Matrix<double, Dynamic, Dynamic, ColMajor> > filter_matrix(filters + offset, cnt_feature_dim, cnt_filters);
Then I computed the product of the two matrices as follows:
MatrixXd* response = new MatrixXd(cnt_features, cnt_filters);
response->noalias() = feature_matrix * filter_matrix;
It sometimes happened so that the value of the entry (i, j) in the "response" matrix did not match with the dot product of the i-th row of feature_matrix and j-th column of filter_matrix. Weird!
Then I realized that the problem stems from a call to "omp_set_dynamic(1)" that I had in my code. If I remove that line the code seems to run just fine.
Sobhan
3607
1
477
chtz
2014-07-15 18:30:46 +0000
Created attachment 477
Test case for bug 714
I'm able to reproduce this issue with gcc-4.7.1 (32bit), but not with 4.7.3, 4.6.3 or 4.8.2 (the latter are all 64bit).
This could be a bug in that gcc version. As you experienced it on 64bit, bitness does not seem to matter.
3614
2
chtz
2014-07-16 15:43:59 +0000
I pushed the test case into the repository. This might help us to isolate failing compiler versions.
4357
3
gael.guennebaud
2015-02-18 15:27:51 +0000
Fixed:
devel: https://bitbucket.org/eigen/eigen/commits/caed3d1925be/
3.2: https://bitbucket.org/eigen/eigen/commits/812c75e
477
2014-07-15 18:30:46 +0000
2014-07-15 18:30:46 +0000
Test case for bug 714
Bug714.patch
text/plain
761
chtz
ZGlmZiAtLWdpdCBhL3Rlc3QvcHJvZHVjdF9sYXJnZS5jcHAgYi90ZXN0L3Byb2R1Y3RfbGFyZ2Uu
Y3BwCi0tLSBhL3Rlc3Q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