The IVDEP Directive
With indexed addressing IVDEP is the only way to specify no data dependencies to the compiler:
- here ivdep means that the integer values stored in indx array are all different, I.e. indx is a permutation array
- assuming no data dependencies will produce faster processor code, because compiler has less constraints on ordering the load-store instructions
-
The IVDEP directive to the compiler is not part of the language and its interpretation is not standardized.
void update(int n, float *a, float *b,
for(i=0; i<n; i++) a[indx[i]] += s*b[i];