Skip to content

Commit

Permalink
Use CRS matrix sort, instead of Kokkos::sort on each row (kokkos#1553)
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-kelley authored and ndellingwood committed Jan 3, 2023
1 parent ddf1b3d commit 3c4331e
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/sparse/impl/KokkosSparse_spiluk_symbolic_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <KokkosKernels_config.h>
#include <Kokkos_ArithTraits.hpp>
#include <KokkosSparse_spiluk_handle.hpp>
#include <Kokkos_Sort.hpp>
#include <KokkosSparse_SortCrs.hpp>
#include <KokkosKernels_Error.hpp>

//#define SYMBOLIC_OUTPUT_INFO
Expand Down Expand Up @@ -451,18 +451,12 @@ void iluk_symbolic(IlukHandle& thandle,
thandle.set_nnzU(cntU);

// Sort
for (size_type row_id = 0;
row_id < static_cast<size_type>(L_row_map.extent(0)) - 1; row_id++) {
size_type row_start = L_row_map(row_id);
size_type row_end = L_row_map(row_id + 1);
Kokkos::sort(subview(L_entries, Kokkos::make_pair(row_start, row_end)));
}
for (size_type row_id = 0;
row_id < static_cast<size_type>(U_row_map.extent(0)) - 1; row_id++) {
size_type row_start = U_row_map(row_id);
size_type row_end = U_row_map(row_id + 1);
Kokkos::sort(subview(U_entries, Kokkos::make_pair(row_start, row_end)));
}
KokkosSparse::sort_crs_graph<Kokkos::DefaultHostExecutionSpace,
decltype(L_row_map), decltype(L_entries)>(
L_row_map, L_entries);
KokkosSparse::sort_crs_graph<Kokkos::DefaultHostExecutionSpace,
decltype(U_row_map), decltype(U_entries)>(
U_row_map, U_entries);

// Level scheduling on L
if (thandle.get_algorithm() ==
Expand Down

0 comments on commit 3c4331e

Please sign in to comment.