Skip to content

Commit

Permalink
bug fix: scale C when k = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
albestro committed Nov 16, 2023
1 parent 93c5f5a commit 78f492b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/dlaf/multiplication/general/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <dlaf/blas/tile.h>
#include <dlaf/blas/tile_extensions.h>
#include <dlaf/common/assert.h>
#include <dlaf/common/index2d.h>
#include <dlaf/common/pipeline.h>
Expand All @@ -37,6 +38,14 @@ void General<B, D, T>::callNN(const T alpha, MatrixRef<const T, D>& 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<B>()));
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) {
Expand Down

0 comments on commit 78f492b

Please sign in to comment.