Skip to content

Commit

Permalink
SPMM: Restrict empty() calls to block-sparse execution
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Oct 28, 2024
1 parent 319cd6b commit 3d4632c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/spmm/spmm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,11 @@ class SpMM25D {
const blk_t& B = baseT::template get<1>(_ijk);
blk_t& C = baseT::template get<2>(_ijk);

#if defined(BLOCK_SPARSE_GEMM)
if (C.empty()) {
C = blk_t(btas::Range(A.range().extent(0), B.range().extent(1)), 0.0);
}
#endif // BLOCK_SPARSE_GEMM

#ifdef HAVE_SPMM_DEVICE
/* pull all buffers onto the device */
Expand Down

0 comments on commit 3d4632c

Please sign in to comment.