vector expression question.
Tobias Burnus
burnus@net-b.de
Thu Nov 17 19:57:00 GMT 2011
Tim Prince wrote:
> If you persuade a compiler to vectorize such a situation, you have no
> control over the order of assignments. I expect the compilers which
> got the same result as for sequential execution did so by refusing to
> vectorize.
I am not so sure. On one hand xser(:) = 2 and
intel 10 x=1...
Intel 11 x=2...
Intel 12 x=2...
If I follow your suggestion, I would conclude that ifort 10 vectorizes
the loop and ifort 11/12 don't, which is unlikely.
On the other hand, with gfortran I get the same result with -O0 and with
-Ofast. And "-ftree-vectorizer-verbose=1" shows that gfortran vectorizes
the loop with -Ofast.
Thus, it really depends on the internal algorithm. As the code is
invalid, one cannot really tell which internal algorithm is better.
Tobias
More information about the Fortran
mailing list