problem with vectorization

problem with vectorization

We use Intel compiler 6.0 build 020312Z, Debian 2.4.18
It works great, but:

During the compilation of this part of code,vectorizer reports for inner loop:
"unsupported loop structure"

void mv_crspec (double *a,float *b,float *c,long *adr,long *ci,long n)
...
float **d_pole;
int *d_zac,j,i;
float *x,*y;
for (i=zbyly_vrstvy[i2];i {
//#pragma ivdep
x=d_pole;
y=b+d_zac_x;
for (j=0;j<=(d_kon-d_zac);j++)
{
c[j+d_zac]+=x[j]*y[j];
}
}
...

Used switches:
-O3 -fno_alias -pc64 -tpp6 -xK -ipo -align -Zp16

where is the problem ?
All arrays are float,cycle is "normal" with stride 1.

Thanks.

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

xsimecek - Welcome! I apologize for not having had a chance to go into this in more detail!

Is there a chance you could post a compilable snippet. That would be easier to read...

Cheers,
Ganesh

Hi,

The answer is found in the User's Guide, under Optimizations->Vectorization->Loop Constructs:

Loop Exit Conditions

Loop exit conditions determine the number of iterations that a loop executes. For example, fixed indexes
for loops determine the iterations. The loop iterations must be countable; that is, the number of iterations
must be expressed as one of the following:
A constant
A loop invariant term
A linear function of outermost loop indices
Loops whose exit depends on computation are not countable.

So your loop that reads:

for (j=0;j<=(d_kon-d_zac);j++)
{ ... }

can't be vectorized because the exit condition is a calculation - d_kon-d_zac.

Brandon
Intel Developer Support

For on-line assistance: http://support.intel.com/support/performancetools
For product support information: http://www.intel.com/software/products/support
* Intel and Pentium are registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries
* Other names and brands may be claimed as the property of others

Brandon Hewitt Technical Consulting Engineer For 1:1 technical support: http://premier.intel.com Software Product Support info: http://www.intel.com/software/support

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen