Re: [eigen] Matrix product crashes when compiled with MSVC 2010 in release |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Matrix product crashes when compiled with MSVC 2010 in release
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Fri, 13 Aug 2010 16:03:53 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=klS+bxu1F+ZPDj0OzzjNTtvY0WILkxJGmnxF9jHNG5o=; b=Gbtr4JdllnjNkonII+lxVeb6M7raKtE4IGURXdLFc5wUQMxPpfc8rVbZLGhrjKz5Id UUY2ak3dAhgH1j2rJaWj8NeLJ3DuRuRwVmgATV63B04wgCZeB/s087Dw81HyN4BD/yA9 2V5FVIEH5k2I36sBjm9IpYLQCU+7/0mZT9/5I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YC97vFhekAf2gqgPYHl1c+x6NOWfNsa8l/hmwNuxUz7fZoId7f9rk4OZNkmJ0pI8Kg 9uR10yxux8kE6SlBWaw9JjUVxfvBOa7YvrXgva7P4YTIJCyAzOSSuD6MXBMZAcNNRw6P KRvWqG0+pGzEnzavOFN0/rxia0vgwN1mCYlBs=
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.