From 3d4632c8746aa7a23bd1ad73ade2dc7975bb2c11 Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Mon, 28 Oct 2024 17:50:07 -0400 Subject: [PATCH] SPMM: Restrict empty() calls to block-sparse execution Signed-off-by: Joseph Schuchart --- examples/spmm/spmm.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/spmm/spmm.cc b/examples/spmm/spmm.cc index 26c6f4aa9..bc376e185 100644 --- a/examples/spmm/spmm.cc +++ b/examples/spmm/spmm.cc @@ -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 */