Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Error in example (15.0 compiler online manual)

$
0
0

The page at https://software.intel.com/en-us/node/524530 (Description of omp simd) has an example that is wrong (or weird) in two ways.

The example is 

#pragma omp simd collapse(2)
for(i=0; i<N; i++) { a[i] = b[i] * c[i];
   for(i=0; i<N; i++) { d[i] = e[i] * f[i]; }
}

Firstly, that loop nest cannot be collapsed, since it is not perfectly nested.

Secondly the same loop variable is used in each loop, a definite bug!

 


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>