- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a strange problem when I try to use AVX/SIMD instructions in the kernel of an OpenMP parallel for loop. While the program works perfectly when compiled with g++ or clang++, it fails when compiled with icpc (Version 17.0.4 under Ubuntu Linux 16.04).
I was able to reduce the problematic code to the following simple (but senseless) C++ program:
-----------------------------------------------
#include <immintrin.h>
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
#pragma omp parallel for
for (int i = 1; i <= 2; ++i)
{
const __m256d x = _mm256_set1_pd(1.0);
cout << x[0] << endl;
}
return 0;
}
-----------------------------------------------
If I compile this with "icpc -O0 -xavx ..." (OpenMP disabled), I get two times the result "1" - as expected.
If I compile it with "icpc -O0 -xavx -fopenmp ..." (OpenMP enabled), I get two time the result "3.11147e-317". The result varies somehow randomly, but is always positve and very small (around 1e-317).
What is going on here? Is there a possibility to mitigate this strange behaviour?
Thanks & best regards!
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefan,
It looks like a bug to me. Can you please report it at https://supporttickets.intel.com
Regards,
Viet Hoang

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page