Thanks alot for the clarifications, a lot to learn from these
answers :-)!
I needed int64, because I do some stupid grid index computations.
tested again with the advice, an everything became true :-) Eigen is
exactly as fast!
BR
On 10/05/2015 08:05 PM, Nate Yonkee
wrote:
Thanks for clearing that up Christoph. I'm always
impressed with how beautiful Eigen is.
On Oct 5, 2015 11:30 AM, "Christoph
Hertzberg" < chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
On 05.10.2015 19:20, Nate Yonkee wrote:
Christoph,
You were right about moving the operations outside of main.
For long long
ints the two times are within 1%, even with vectors of
length 300. But with
doubles Eigen is twice as fast at a length of 300; the times
are close only
when I use a tiny length of 3. Do we expect a discrepancy
between long
longs and doubles?
Yes, because doubles are SSE-optimized (if the size is even or
Dynamic at compile time -- i.e. you might get faster times for
4d than for 3d vectors ...)
If you use int32 instead of uint64 you should get a speedup of
about 4 (if the size is a multiple of 4).
Christoph
On Mon, Oct 5, 2015 at 11:02 AM, Christoph Hertzberg <
chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
On 05.10.2015 18:08, Gabriel wrote:
Thanks a lot!
I thought something is flawed, but
I compared the assembler output with comments of the
following
(hopefully unflawed problem, random numbers, all the
same )
http://pastebin.com/qDvLGBfU
I get close timings, but Eigen3 is still slower what can
also be seen
from the assembler output below
Is my example still flawed, the Eigen internal dense
assignment loop is
not inlined?
Unfortunately, GCC sometimes fails to properly optimize
code inside the
main function. After moving your code into a different
function, I get
exactly the same assembly (except for a cmovle/cmovs
difference, because
you put the zero in front and not at the end, in the Eigen
version).
If you still experience speed-differences, it's because
the second loop
can work with already initialized caches.
Christoph
--
Dipl. Inf., Dipl. Math. Christoph Hertzberg
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany
Zentrale: +49 421 178
45-6611
Besuchsadresse der Nebengeschäftstelle:
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178
45-4021
Empfang: +49 421 178
45-6600
Fax: +49 421 178
45-4150
E-Mail: chtz@xxxxxxxxxxxxxxxxxxxxxxxx
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
--
Dipl. Inf., Dipl. Math. Christoph Hertzberg
Universität Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Straße 1
28359 Bremen, Germany
Zentrale: +49 421 178 45-6611
Besuchsadresse der Nebengeschäftstelle:
Robert-Hooke-Straße 5
28359 Bremen, Germany
Tel.: +49 421 178 45-4021
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: chtz@xxxxxxxxxxxxxxxxxxxxxxxx
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
|