Absence of Loop-carried Memory Dependency with IVDEP Directive

For applications designed to run on IA-64 architectures, the -ivdep-parallel (Linux*) or /Qivdep-parallel (Windows*) option indicates there is no loop-carried memory dependency in the loop where an IVDEP pragma is specified. This technique is useful for some sparse matrix applications.

Note

Mac OS*: This option is not supported.

For example, the following loop requires the parallel option in addition to the directive ivdep to indicate there is no loop-carried dependencies:

Example

#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;

}

For example, the following loop requires the parallel option in addition to the IVDEP pragma to ensure there is no loop-carried dependency for the store into a().

Example

#pragma ivdep

for (j=0; j<n; j++)

{

  a[b[j]] = a[b[j]] + 1;

}

prefetch Directive

The prefetch directive is supported on IA-64 architecture only.

The syntax is

The following example demonstrates how to use the prefetch directive.

Example

for (i=i0; i!=i1; i+=is) {

 

float sum = b[i];

int ip = srow[i];

int c = col[ip];

 

#pragma noprefetch col

#pragma prefetch value:1:80

#pragma prefetch x:1:40

 

for(; ip<srow[i+1]; c=col[++ip])

  sum -= value[ip] * x[c];

  y[i] = sum;

}

See also Vectorization support.