[Numpy-discussion] Openmp support (was numpy's future (1.1 and beyond): which direction(s) ?)
James Philbin
philbinj at gmail.com
Sat Mar 22 14:01:08 EDT 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.
James
More information about the NumPy-Discussion
mailing list