![]() Registered Member ![]()
|
I perform the dot product operation of a vector and a vector segment. Both are complex<double> valued. This is the code segment in question:
where L = w.size() and idxS is some non-negative integer smaller or equal vec.size()-L. I compile my code with the "-std=c++11 -g -O3 -Wall -march=native" flags. I am on the newest Mac OS X and compile with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn). The problem is that eigen won't use packed SSE instructions for the dot product computation making the code probably slower than necessary. This is the assembly code I get for the above code snippet:
Each complex<double> occupies 128 bits in memory so I would not think memory alignment is an issue and I had thought something like the follwing would work and speed up performance by a factor of two: http://wwweic.eri.u-tokyo.ac.jp/computer/manual/altix/compile/CC/Intel_Cdoc100/main_cls/mergedProjects/intref_cls/common/intref_sample_double_comp.htm |
![]() Moderator ![]()
|
You probably did not looked at the right part of the assembly, because here is what I got (same compiler, same OS):
clang++ -O3 -DNDEBUG -std=c++11 -mavx -S
and with: clang++ -O3 -DNDEBUG -std=c++11 -march=native -S
C++ file to reproduce:
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]