I am a beginner symbic, I read this article on this topic (since I use an AVX2-compatible machine).
Now I read this question to check if the pointer is aligned.
I am testing it with this main.cpp toy example:
#include <iostream>
And compile it with icpc -std=c++11 -o main main.cpp .
Result Printing:
1 1 1 1
However, if I add these 3 lines before 4 prints:
for(int i=0; i<8; i++) std::cout<<a[i]<<" "; std::cout<<std::endl;
This is the result:
0 1 2 3 4 5 6 7 1 1 0 1
In particular, I do not understand that the last 0 . Why is it different from the last print? What am I missing?
c ++ vectorization c ++ 11 simd avx2
cplusplusuberalles
source share