Are there always differences between simd and ivdep pragmas?

I am currently trying to do a vector animation of a program, and I have observed odd behavior

The for loop seems to be vectorized when used

#pragma simd

(262): (see 3) note: SIMD LOOP VECTORED.

but this does not happen when i use

# vector is always used

#pragma ivdep

(262): (see 3) remark: the cycle was not vectorized: the existence of vector dependence.

I always thought that both sentences make the same vector

+3
source share
2 answers

pragma simd provides a loop vector, regardless of cost or security.

pragma vector . , , .

pragma ivdep , (, ), . , , . (a [i] = a [i - 1] * c), simd .

, pragma simd, - , . , .

: Intel (http://software.intel.com/en-us/node/462880)

+4

Pragma SIMD - , , https://software.intel.com/en-us/node/514582, - , , . , " / ". Pragma https://software.intel.com/en-us/node/514586. , - , . #pragma simd , . , , :

   void foo(float *a, float *b, float *c, int N){
   #pragma vector always
   #pragma ivdep
   //#pragma simd vectorlength(2)
   for(int i = 2; i < N; i++)
        a[i] = a[i-2] + b[i] + c[i];
   return;
   }

ICC :

$ icc -c -vec-report2 test11.cc
test11.cc(5): (col. 1) remark: loop was not vectorized: existence of vector dependence

ICC SSE2, 128- XMM-. 4 XMM, 4 , . , pragma . 4, 2 , . :

void foo(float *a, float *b, float *c, int N){
//#pragma vector always
//#pragma ivdep
#pragma simd vectorlength(2)
for(int i = 2; i < N; i++)
        a[i] = a[i-2] + b[i] + c[i];
return;
}
$ icc -c -vec-report2 test11.cc
test11.cc(5): (col. 1) remark: SIMD LOOP WAS VECTORIZED

#pragma vector , . , -. , , , . https://software.intel.com/sites/default/files/article/402486/intel-cilk-plus-white-paper.pdf Intel (R) Cilk (TM) Plus " pragma simd vectorlength" " $pragma simd reduction private clause", , pragma simd . , , . #pragma simd , , .

, - . https://software.intel.com/en-us/articles/outer-loop-vectorization.

+2

All Articles