From 78f492bfe4f6a51983da39340c778accd164fa60 Mon Sep 17 00:00:00 2001 From: Alberto Invernizzi Date: Thu, 16 Nov 2023 11:47:55 +0100 Subject: [PATCH] bug fix: scale C when k = 0 --- include/dlaf/multiplication/general/impl.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/dlaf/multiplication/general/impl.h b/include/dlaf/multiplication/general/impl.h index 2fc28c1df1..62d429ca19 100644 --- a/include/dlaf/multiplication/general/impl.h +++ b/include/dlaf/multiplication/general/impl.h @@ -11,6 +11,7 @@ #pragma once #include +#include #include #include #include @@ -37,6 +38,14 @@ void General::callNN(const T alpha, MatrixRef& mat_a, Matri DLAF_ASSERT_HEAVY(matrix::multipliable(mat_a, mat_b, mat_c, blas::Op::NoTrans, blas::Op::NoTrans), mat_a, mat_b, mat_c); + if (mat_a.nrTiles().cols() == 0) { + for (SizeType j = 0; j < mat_c.nrTiles().cols(); ++j) + for (SizeType i = 0; i < mat_c.nrTiles().rows(); ++i) + ex::start_detached(dlaf::internal::whenAllLift(beta, mat_c.readwrite(GlobalTileIndex(i, j))) | + tile::scal(dlaf::internal::Policy())); + return; + } + for (SizeType j = 0; j < mat_c.nrTiles().cols(); ++j) { for (SizeType i = 0; i < mat_c.nrTiles().rows(); ++i) { for (SizeType k = 0; k < mat_a.nrTiles().cols(); ++k) {