diff --git a/examples/spmm/spmm.cc b/examples/spmm/spmm.cc index 7e0232525..bf1fc0a89 100644 --- a/examples/spmm/spmm.cc +++ b/examples/spmm/spmm.cc @@ -365,11 +365,13 @@ class SpMM25D { // release the first bcast(s) auto pbcasts = parallel_bcasts_; auto release_k = k_cnt.begin(); + release_k_ = release_k; // this will be released while (pbcasts-- > 0 && (k_cnt.end() != release_k)) { - release_k = std::find_if(release_k, k_cnt.end(), [](std::size_t c){ return c > 0; }); + release_k_ = release_k; + release_k = std::find_if(release_k++, k_cnt.end(), [](std::size_t c){ return c > 0; }); } - constraint->release(*release_k); + constraint->release(*release_k_); TTGUNUSED(bcast_a_); TTGUNUSED(bcast_b_);