Re: [eigen] Matrix product crashes when compiled with MSVC 2010 in release

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


On Fri, Aug 13, 2010 at 4:00 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2010/8/13 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> Unfortunately, the patch creates a wrong result:
>
> +#if defined(EIGEN_VECTORIZE) && defined(_MSC_VER) && !defined(_WIN64)
> +    const AccPacket tmp1 = ei_pmul(alpha,c);
> +    const AccPacket tmp2 = ei_pmul(alpha,r);
> +    r = ei_padd(tmp1,tmp2);
> +#else
>     r = ei_pmadd(c,alpha,r);
> +#endif
>
> Here, the current code r=pmadd(c,alpha,r) does (in pseudocode):
>
>    r = alpha*c+r.
>
> But your variant does instead:
>
>    r = alpha*c + alpha*r

Ups, too hasty.



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