Fix number of block columns to NOT overflow the cache (PowerPC) abnormally in GEMV

This commit is contained in:
Chip Kerchner 2022-01-27 20:35:53 +00:00 committed by Rasmus Munk Larsen
parent 7db0ac977a
commit 66464bd2a8

View File

@ -416,7 +416,7 @@ EIGEN_STRONG_INLINE void gemv_col(
#endif
// TODO: improve the following heuristic:
const Index block_cols = cols < 128 ? cols : (lhsStride * sizeof(LhsScalar) < 32000 ? 16 : 16);
const Index block_cols = cols < 128 ? cols : (lhsStride * sizeof(LhsScalar) < 16000 ? 16 : 8);
ResPacket palpha = pset1<ResPacket>(alpha);
for (Index j2 = 0; j2 < cols; j2 += block_cols)
@ -1622,7 +1622,7 @@ EIGEN_STRONG_INLINE void gemv_complex_col(
const Index n1 = rows - 1 * ResPacketSize + 1;
// TODO: improve the following heuristic:
const Index block_cols = cols < 128 ? cols : (lhsStride * sizeof(LhsScalar) < 32000 ? 16 : 16);
const Index block_cols = cols < 128 ? cols : (lhsStride * sizeof(LhsScalar) < 16000 ? 16 : 8);
typedef alpha_store<PResPacket, ResPacket, ResScalar, Scalar> AlphaData;
AlphaData alpha_data(alpha);