Skip to content

Commit

Permalink
Make spiluk_handle::reset backwards compatible (#2087)
Browse files Browse the repository at this point in the history
* Make spiluk_handle::reset backwards compatible

By making block_size default to -1, which means don't change
block size.

* Switch default val for block_size for reset_handle

* formatting

* Fix comment
  • Loading branch information
jgfouca authored Jan 17, 2024
1 parent c34c6c5 commit aa12597
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions sparse/src/KokkosSparse_spiluk_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,28 @@ class SPILUKHandle {
team_size(-1),
vector_size(-1) {}

void reset_handle(const size_type nrows_, const size_type nnzL_,
const size_type nnzU_, const size_type block_size_) {
void reset_handle(
const size_type nrows_, const size_type nnzL_, const size_type nnzU_,
const size_type block_size_ = Kokkos::ArithTraits<size_type>::max()) {
set_nrows(nrows_);
set_num_levels(0);
set_nnzL(nnzL_);
set_nnzU(nnzU_);
set_block_size(block_size_);
// user likely does not want to reset block size to 0, so set default
// to size_type::max
if (block_size_ != Kokkos::ArithTraits<size_type>::max()) {
set_block_size(block_size_);
}
set_level_maxrows(0);
set_level_maxrowsperchunk(0);
level_list = nnz_row_view_t("level_list", nrows_),
level_idx = nnz_lno_view_t("level_idx", nrows_),
level_ptr = nnz_lno_view_t("level_ptr", nrows_ + 1),
hlevel_ptr = nnz_lno_view_host_t("hlevel_ptr", nrows_ + 1),
level_nchunks = nnz_lno_view_host_t(),
level_nrowsperchunk = nnz_lno_view_host_t(), reset_symbolic_complete(),
level_list = nnz_row_view_t("level_list", nrows_);
level_idx = nnz_lno_view_t("level_idx", nrows_);
level_ptr = nnz_lno_view_t("level_ptr", nrows_ + 1);
hlevel_ptr = nnz_lno_view_host_t("hlevel_ptr", nrows_ + 1);
level_nchunks = nnz_lno_view_host_t();
level_nrowsperchunk = nnz_lno_view_host_t();
iw = work_view_t();
reset_symbolic_complete();
}

virtual ~SPILUKHandle(){};
Expand Down

0 comments on commit aa12597

Please sign in to comment.