Fix computeProductBlockingSizes with m==0, and add respective unit test.

This commit is contained in:
Gael Guennebaud
2015-03-31 15:19:57 +02:00
parent bd76d837e6
commit ae01c05e18
2 changed files with 31 additions and 5 deletions

View File

@@ -249,10 +249,9 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n
actual_lm = l2;
max_mc = 576;
}
Index mc = (std::min<Index>)(actual_lm/(3*k*sizeof(LhsScalar)), max_mc);
if (mc > Traits::mr) mc -= mc % Traits::mr;
else if (mc==0) return;
m = (m%mc)==0 ? mc
: (mc - Traits::mr * ((mc/*-1*/-(m%mc))/(Traits::mr*(m/mc+1))));
}