Skip to content

Commit

Permalink
Make spiluk_handle::reset backwards compatible
Browse files Browse the repository at this point in the history
By making block_size default to -1, which means don't change
block size.
  • Loading branch information
jgfouca committed Jan 12, 2024
1 parent 66f60e9 commit 0895a71
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions sparse/src/KokkosSparse_spiluk_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,26 @@ class SPILUKHandle {
vector_size(-1) {}

void reset_handle(const size_type nrows_, const size_type nnzL_,
const size_type nnzU_, const size_type block_size_) {
const size_type nnzU_, const size_type block_size_ = -1) {
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 -1
if (block_size_ != static_cast<size_type>(-1)) {
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 0895a71

Please sign in to comment.