Re: [eigen] matrix::linspace

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Sun, Jan 24, 2010 at 8:16 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2010/1/24 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
>> which is nice and reasonable. So, MSVC has an optimization issue over
>> here. In my particular case, the unaligned cases are anyways empty and
>> skipping them does not hurt.
>
> This could then be quite far reaching: this path in Assign.h is used
> for much more than just this particular functor, so this is really
> worth understanding and fixing / working around!

I don't really understand what is going on nor why it is. I can tell
that the ASM code is different and not optimal but I do not know
exactly why. With some tinkering, I was able to create a fix which you
find attached.

In short, it does the following. The unaligned paths are once more
wrapped into a proxy object which is specialized for cases where the
unaligned path is non-existent (of zero length). We can make use of it
in some cases, in particular, when the destination is aligned which we
do already know at compile time. That approach allows MSVC to perform
the correct optimization.

I did not push since it's quite a low-level modification.

- Hauke

Attachment: assign_opt.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/