Re: [eigen] Performance colwise matrix mult vs. raw loop

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




On Tue, Jan 16, 2018 at 9:40 PM, Norbert Wenzel <norbert.wenzel.lists@xxxxxxxxx> wrote:

I understand you cannot determine any aliasing issues at compile time.
But I fail to see why there is no way to determine the size of the
temporary. Do you mean this cannot be done in Eigen as it is now or this
can generally not be determined at compile time?

This is very difficult because aliasing might appear in very different ways, e.g.:

M = A * M.transpose();

with M square. Moreover, depending on the sizes of the matrices, a column-by-column (or row-by-row) evaluation can be extremely slow and creating a whole temporary can be orders of magnitude faster. Moreover, in order to not kill performance of small matrices, we must decide on the evaluation strategy through very few runtime checks.

gael

 
> In your case, we would need some kind of colwise/rowwise noalias [...]..
> To be honest I've
> never though about that possibility, but [...] this might be worth the> effort.

Thanks for considering this possibility.

As I've already said this issue was primarily surprising to me because I
thought colwise/rowwise would essentially boil down to the loop code
I've written manually. Your explanation shed some light on this issue
but clearly demonstrated, that I need to understand Eigen internals
better, when I care about runtime performance.

Best regards,
Norbert





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