I am having a code which is using Eigen::vectors, I want to confirm that Eigen has optimized this code for SSE or not.
I am using Visual Studio 2012 Express, in which i can set the command line option "/Qvec-report:2" which gives the optimization details of C++ code. Is there any option in visual studio or Eigen which can tell me that code has been optimized or not?
My code is as below:
#include <iostream>
#include <vector>
#include <time.h>
#include<Eigen/StdVector>
int main(char *argv[], int argc)
{
    int tempSize=100;
/** I am aligning these vectors as specfied on http://eigen.tuxfamily.org/dox/group__TopicStlContainers.html */
    std::vector<Eigen::Vector3d,Eigen::aligned_allocator<Eigen::Vector3d>> eiVec(tempSize);
    std::vector<Eigen::Vector3d,Eigen::aligned_allocator<Eigen::Vector3d>> eiVec1(tempSize);
    std::vector<Eigen::Vector3d,Eigen::aligned_allocator<Eigen::Vector3d>> eiVec2(tempSize);
    for(int i=0;i<100;i++)
    {
        eiVec1[i] = Eigen::Vector3d::Zero();
        eiVec2[i] = Eigen::Vector3d::Zero();
    }
    Eigen::Vector3d *eV = &eiVec.front();
    const Eigen::Vector3d *eV1 = &eiVec1.front();
    const Eigen::Vector3d *eV2 = &eiVec2.front();
/** Below loop is not vectorized by visual studio due to code 1304: 
    Because here comes the operations at level of Eigen, I want to 
    know here whether Eigen has optimized this operation or not? */
    for(int i=0;i<100;i++)
    {
        eV[i] = eV1[i] - eV2[i];
    }
    return 0;
}
 
    