Absence of Loop-carried Memory Dependency

For ItaniumŪ-based applications, the -ivdep_parallel option indicates there is absolutely no loop-carried memory dependency in the loop where the IVDEP directive is specified. This technique is useful for some sparse matrix applications. For example, the following loop requires -ivdep_parallel in addition to the directive IVDEP to indicate there is no loop-carried dependencies.

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

}

The following example shows that using this option and the IVDEP directive ensures there is no loop-carried dependency for the store into a().

#pragma ivdep

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

{

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

}

PREFETCH Directive

The PREFETCH directive is supported on Itanium®-based systems only.

Syntax:

#pragma prefetch var:hint:distance

where hint value can be 0 (T0), 1 (NT1), 2  (NT2), or 3 (NTA)

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;

}