Skip to content

Commit

Permalink
sparse: spadd_symbolic fences before device values used on host (#2259)
Browse files Browse the repository at this point in the history
* sparse: spadd_symbolic fences before device values used on host

* sparse: use prefix sum to remove explicit spadd fence
  • Loading branch information
cwpearson authored Jul 1, 2024
1 parent 1df84bb commit 0a0c048
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sparse/impl/KokkosSparse_spadd_symbolic_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ void spadd_symbolic_impl(
"KokkosSparse::SpAdd:Symbolic::InputNotSorted::CountEntries",
range_type(exec, 0, nrows), countEntries);
KokkosKernels::Impl::kk_exclusive_parallel_prefix_sum<execution_space>(
exec, nrows + 1, c_rowmap_upperbound);
Kokkos::deep_copy(exec, c_nnz_upperbound,
Kokkos::subview(c_rowmap_upperbound, nrows));
exec, nrows + 1, c_rowmap_upperbound, c_nnz_upperbound);
}
ordinal_view_t c_entries_uncompressed(
Kokkos::view_alloc(exec, Kokkos::WithoutInitializing,
Expand Down Expand Up @@ -595,6 +593,7 @@ void spadd_symbolic_impl(
// provide the number of NNZ in C to user through handle
size_type cmax;
Kokkos::deep_copy(exec, cmax, Kokkos::subview(c_rowmap, nrows));
exec.fence("fence before cmax used on host");
addHandle->set_c_nnz(cmax);
addHandle->set_call_symbolic();
addHandle->set_call_numeric(false);
Expand Down

0 comments on commit 0a0c048

Please sign in to comment.