[Numpy-discussion] Openmp support (was numpy's future (1.1 and beyond): which direction(s) ?)

James Philbin philbinj@gmail....
Sat Mar 22 13:01:08 CDT 2008

>  gcc keeps advancing autovectorization.  Is manual vectorization worth the
>  trouble?

Well, the way that the ufuncs are written at the moment,
-ftree-vectorize will never kick in due to the non-constant strides.
To get this to work, one has to special case out unary strides. Even
with constant strides -ftree-vectorize often produces sub-optimal code
as it has to make very conservative assumptions about the content of
variables (it can do better if -fstrict-aliasing is used, but I think
numpy is not compiled with this flag). So in other words, yes, I think
it is worth hand vectorizing (and unrolling) the most common cases.


More information about the Numpy-discussion mailing list