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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 13 Aug 2010 10:06:29 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=HKtols5T0h0DUpfoPrw2RdBIVfBpohv894XBVnOPBmk=; b=q4kQJh+XRxyrWNFvarvXchxERbp+tjNd3ieWWcPzSj+jzlNBZWKDundpb2EaGA1L3A 0fwKNghm29UIaT5X0qJ6hiiDvyGrplgoKOwF14LPV3F24u0F2OXU4F2xjhW1YeP2HnXU lJMyH8TdytLiTM3aC41FpHMu3/T62zGPz6k4s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=j+c55n+/BIuJ04Bc+JYtTIa+wPVvdZzi8tmkZ1+efTAMzhb12K6rxcUHxTpuZrFLAJ AQ3TNTukgrGASyHX29SBSxjQ1mBtWo0IFLIN/vTZhyyQeoR8MomeX0zP43yxuou/aW2c 5lZxd/qOIVfF1pLkhLJKciHgpwjUiCY8lH5yU=
2010/8/13 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> 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.
Here's a fun counter-proposal: if the issue is really that MSVC
mis-compiles ei_pmadd, how about implementing it with asm volatile?
Benoit