I am trying to load a vector into the SSE register, my code compiles without error, but when I am trying to run it, I've got segmentation fault. Here it is my code:
inline int SSEJaccard::calcSSEJaccardDist(unsigned int id1, unsigned int id2) {
int result;
__m128i v, v1;
std::vector<uint32_t> &fv1 = fvs[id1];
std::vector<uint32_t> &fv2 = fvs[id2];
v = _mm_load_si128((__m128i const*) (&fv1));
v1 = _mm_load_si128((__m128i const*) (&fv2));
v = _mm_and_si128(v,v1);
result =_mm_extract_epi16(v, 0) + _mm_extract_epi16(v, 4);
return result;
}
And fsv is a global variable which is defined like this:
std::vector<std::vector<uint32_t> > fvs;
I am using Intel Compiler (ICC). Thank you