Registered Member
|
There seems to be some problem with Eigen when used with cygwin and Mingw, as the performance is not satisfying, while under linux the performance is quite good.
Lets take the Coulomb energy as an example:
when compiled on linux g++ -S -m32 -msse2 -mfpmath=sse -O3 (version 4.5.0), the loop body looks something like below, wich is pretty good
on the other hand using cygwin g++ -S -O3 -msse2 -mfpmath=sse (vertion 4.5.3) it results int the following:
with __ZNK5Eigen16CwiseUnaryOpImplINS_8internal18scalar_multiple_opIfEEKNS_5ArrayIfLin1ELi1ELi0ELin1ELi1EEENS_5DenseEE6packetILi1EEEU8__vectorfi
obviously gcc does not inline the .square() call, thus dramatically reducing performance. It also does not recognize xp, yp ... as loop constants and therefore reloads them every loop iteration. Ive tried playing with gcc params and flags, however to no success. Has anyone else come across this problem and maybe found a solution? I could really need some help here. Thanks! |
Moderator
|
that's gcc weirdness. Can you try to add EIGEN_STRONG_INLINE in front of the relevant not properly inlined functions?
|
Moderator
|
btw, you might also play with gcc's parameters controlling inlining (like the maximal number of instructions for inlining, etc)
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]