Visible to Intel only — GUID: GUID-B25ABCC2-BE6F-4599-AEDF-2434F4676E1B
Visible to Intel only — GUID: GUID-B25ABCC2-BE6F-4599-AEDF-2434F4676E1B
ivdep
Instructs the compiler to ignore assumed vector dependencies.
Syntax
#pragma ivdep |
Arguments
None
Description
The ivdep pragma instructs the compiler to ignore assumed vector dependencies. To ensure correct code, the compiler treats an assumed dependence as a proven dependence, which prevents vectorization. This pragma overrides that decision. Use this pragma only when you know that the assumed loop dependencies are safe to ignore.
The ivdep pragma is supported in host code only.
In addition to the ivdep pragma, the vector pragma can be used to override the efficiency heuristics of the vectorizer.
The proven dependencies that prevent vectorization are not ignored, only assumed dependencies are ignored.
Examples
The loop in this example will not vectorize without the ivdep pragma, since the value of k is not known; vectorization would be illegal if k < 0:
void ignore_vec_dep(int *a, int k, int c, int m) {
#pragma ivdep
for (int i = 0; i < m; i++)
a[i] = a[i + k] * c;
}
The pragma binds only the for loop contained in current function. This includes a for loop contained in a sub-function called by the current function:
#pragma ivdep
for (i=1; i<n; i++) {
e[ix[2][i]] = e[ix[2][i]]+1.0;
e[ix[3][i]] = e[ix[3][i]]+2.0;
}