Skip to content

Commit

Permalink
src/sparse: spadd
Browse files Browse the repository at this point in the history
  - Use Kokkos::view_alloc(Kokkos::WithoutInitializing, label) due to deprecation of Kokkos::ViewAllocWithoutInitializing
  • Loading branch information
e10harvey committed Jul 15, 2021
1 parent 5462e73 commit da00f7f
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/sparse/KokkosSparse_spadd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ void spadd_symbolic(
}
ordinal_type nrows = a_rowmap.extent(0) - 1;
typedef Kokkos::RangePolicy<execution_space, ordinal_type> range_type;
using NoInitialize = Kokkos::ViewAllocateWithoutInitializing;
if (addHandle->is_input_sorted()) {
runSortedCountEntries
<KernelHandle, alno_row_view_t_, alno_nnz_view_t_,
Expand All @@ -590,7 +589,9 @@ void spadd_symbolic(
// minimizing peak memory usage run the unsorted c_rowmap upper bound
// functor (just adds together A and B entry counts row by row)
clno_row_view_t_ c_rowmap_upperbound(
NoInitialize("C row counts upper bound"), nrows + 1);
Kokkos::view_alloc(Kokkos::WithoutInitializing,
"C row counts upper bound"),
nrows + 1);
size_type c_nnz_upperbound = 0;
{
UnsortedEntriesUpperBound<size_type, ordinal_type, alno_row_view_t_,
Expand All @@ -606,9 +607,13 @@ void spadd_symbolic(
Kokkos::subview(c_rowmap_upperbound, nrows));
}
clno_nnz_view_t_ c_entries_uncompressed(
NoInitialize("C entries uncompressed"), c_nnz_upperbound);
clno_nnz_view_t_ ab_perm(NoInitialize("A and B permuted entry indices"),
c_nnz_upperbound);
Kokkos::view_alloc(Kokkos::WithoutInitializing,
"C entries uncompressed"),
c_nnz_upperbound);
clno_nnz_view_t_ ab_perm(
Kokkos::view_alloc(Kokkos::WithoutInitializing,
"A and B permuted entry indices"),
c_nnz_upperbound);
// compute the unmerged sum
UnmergedSumFunctor<size_type, ordinal_type, alno_row_view_t_,
blno_row_view_t_, clno_row_view_t_, alno_nnz_view_t_,
Expand All @@ -622,10 +627,12 @@ void spadd_symbolic(
KokkosKernels::sort_crs_matrix<execution_space, clno_row_view_t_,
clno_nnz_view_t_, clno_nnz_view_t_>(
c_rowmap_upperbound, c_entries_uncompressed, ab_perm);
clno_nnz_view_t_ a_pos(NoInitialize("A entry positions"),
a_entries.extent(0));
clno_nnz_view_t_ b_pos(NoInitialize("B entry positions"),
b_entries.extent(0));
clno_nnz_view_t_ a_pos(
Kokkos::view_alloc(Kokkos::WithoutInitializing, "A entry positions"),
a_entries.extent(0));
clno_nnz_view_t_ b_pos(
Kokkos::view_alloc(Kokkos::WithoutInitializing, "B entry positions"),
b_entries.extent(0));
// merge the entries and compute Apos/Bpos, as well as Crowcounts
{
MergeEntriesFunctor<size_type, ordinal_type, alno_row_view_t_,
Expand Down

0 comments on commit da00f7f

Please sign in to comment.