I'm just starting to experiment with adding OpenMP to some SSE code.
My first test program SOMETIMES crashes in _mm_set_ps, but it works when I set if (0).
It looks so simple, I have to miss something obvious. I am compiling with gcc -fopenmp -g -march = core2 -pthreads
#include <stdio.h> #include <stdlib.h> #include <immintrin.h> int main() { #pragma omp parallel if (1) { #pragma omp sections { #pragma omp section { __m128 x1 = _mm_set_ps ( 1.1f, 2.1f, 3.1f, 4.1f ); } #pragma omp section { __m128 x2 = _mm_set_ps ( 1.2f, 2.2f, 3.2f, 4.2f ); } } // end omp sections } //end omp parallel return 0; }
source share