Re: [eigen] No vectorization in presence of .cast<T>() calls

[ Thread Index | Date Index | More Archives ]

On Fri, Dec 17, 2010 at 9:48 AM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I think you need to mark the map as aligned (if it is aligned).

Besides that, wouldn't it be useful sometimes, if non-aligned data get's
also vectorized, e.g. if the load-overhead is smaller than the
performance gain? (Or is there some kind of cast possible already?)

No no, that is not the issue. It does not matter whether the map is aligned or not. The advantage of aligned maps is that it is possible to use aligned loads which are much faster than the unaligned ones. It does not affect vectorization itself.

For the moment I am just changing the code to

MatrixXf od_full = img_mat.cast<float>();
od_full = - std::log( od_full.array() / 255.0f + std::numeric_limits<float>::epsilon() );

which leads to no additional temporary and vectorization in the second line.

- Hauke

Mail converted by MHonArc 2.6.19+