Diagnostic 15042: pragma supersedes previous setting

Cause:

This diagnostics message comes when the parameters of the pragma contradicts each other. In this case the #pragma loop count has two clauses, avg() and max(). But max() parameter is lesser than the avg() clause value. Below is an example for this scenario.


Examples:
 

void foo(float *A, int n){
  int i;
#pragma loop count avg(30) max(10)
  for (i=0;i<n;i++){
    A[i] = i;
  }
}


$ icpc -vec-report6 example22.cc -c
example22.cc(4): (col. 3) remark: pragma supersedes previous setting
example22.cc(5): (col. 5) remark: vectorization support: reference A has unaligned access
example22.cc(5): (col. 5) remark: vectorization support: unaligned access used inside loop body
example22.cc(4): (col. 3) remark: LOOP WAS VECTORIZED

Recommendation:

Make sure the max() clause is always greater than avg() clause value.

Einzelheiten zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.