Skip to content

Commit

Permalink
revert csr read move overload
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikvn committed Dec 8, 2023
1 parent 60645ec commit 5c1bc41
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions core/matrix/csr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,25 +485,8 @@ void Csr<ValueType, IndexType>::read(device_mat_data&& data)
auto arrays = data.empty_out();
this->row_ptrs_.resize_and_reset(size[0] + 1);
this->set_size(size);
// Need to copy instead of move, as move into view data is not supported.
if (this->values_.is_owning()) {
this->values_ = std::move(arrays.values);
} else {
if (this->values_.get_size() == arrays.values.get_size()) {
this->values_ = arrays.values;
} else {
GKO_INVALID_STATE("Input values view is of incorrect size!");
}
}
if (this->col_idxs_.is_owning()) {
this->col_idxs_ = std::move(arrays.col_idxs);
} else {
if (this->col_idxs_.get_size() == arrays.col_idxs.get_size()) {
this->col_idxs_ = arrays.col_idxs;
} else {
GKO_INVALID_STATE("Input col_idxs view is of incorrect size!");
}
}
this->values_ = std::move(arrays.values);
this->col_idxs_ = std::move(arrays.col_idxs);
const auto row_idxs = std::move(arrays.row_idxs);
auto local_row_idxs = make_temporary_clone(exec, &row_idxs);
exec->run(csr::make_convert_idxs_to_ptrs(local_row_idxs->get_const_data(),
Expand Down

0 comments on commit 5c1bc41

Please sign in to comment.