|Re: [eigen] Indexes: why signed instead of unsigned?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Indexes: why signed instead of unsigned?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 17 May 2010 17:03:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=TQI7dV2bQs/eXiwtgBZjxIoykRfEN16GN8CWTYDTnro=; b=B7ZLgxQD3GCxdWrx2jA2wNFItNqoV5/oFiL8TN9L8JQ04otAelbF/RUxPZ7CShwXM8 mUWash5XouMBqaQWjEi16f7kddWYYDErfMXEDHGi/FG8ZgQwk7KsB9ZnUYRSLvhFKz8z 5XzJf5anMKnHe/lTKwm/ymGP7/Qrg7bEQbwE8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Lkqa7RDDW9tHf+WBn9CdJjibR1ouLu4xOZ86bREu3Wzayyhz4xfqWbAaEv90oeGyaz t95jyoxUkKPULNj8SOgCQtPeRhxwDncVGUyokcARLmjtPvUdkeTkYiwI+pur5CSnq6FY 0elN4qUfg9paTNo4O+V95nFgPP6bGXwJM/Hro=
On Mon, May 17, 2010 at 1:39 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> c.block(1,12,50,89) += a.block(7,3,50,89) + b.block(70,35,50,89);
> it seems that GCC fails at generating good code and issue 3 imull in the
> most inner vectorized loop. The non vectorized loops (to deal with
> boundaries or when vectorization is disabled) are fine though... ahhhh
> compiler weirdnesses....
this is past :)
The fix is to cache the outer size in Block just like we cache the address of the fist coeff. Actually, it seems it does not like when m_xpr.whatever() is used to compute the address since it does not detect the returned value is constant trough the loop... So for each memory access, it read the actual number of rows of the nested matrix from memory, and multiplied it to the outer index, etc.... just like Matrix::rows was volatile. As a result, 0.58s versus 0..9s for the above _expression_ (repeated a large number of time of course !)
Of course, the same might appear in some other contexts...