Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29010 Discussions

vectorization of short array constructor

TimP
Honored Contributor III
386 Views

forall(i=1:n/2) a(i*2-1:i*2)= b(i)+ [c(i),e(i)] *d(i)

generates efficiently vectorized code with current gfortran, but ifort says there is a dependency which prevents vectorization, regardless of application of directives etc.

Needless to say, more practical examples are more complicated than this, but they seem to encounter the same problem.

In general, one might be more interested in having this work with DO CONCURRENT, if not with original DO, but it seems there is no difference here among them.

I have been trying to submit this on premier.intel.com, but the site isn't responding today.

When we speak of "code modernization," it would seem desirable to be able to optimize code according to F95 or newer standards, rather than to drop back to 25 year old legacy code with the addition of !$omp simd linear() which still gets only 90% of the performance.  There is an f77 version of this which gives full performance with both ifort and gfortran, but I think the array constructor is a clearer and more concise expression of the intent, where the odd subscripted elements are calculated from c and the evens from e.

0 Kudos
1 Reply
TimP
Honored Contributor III
386 Views

Premier site accepted this case today: 6000133255

0 Kudos
Reply