Skip to content

Commit

Permalink
Refactor chunked matrix for accommodating memory-mapped utility module (
Browse files Browse the repository at this point in the history
#192)

* Refactor inference chunked matrix

* Using set to count chunk's nonzero rows
  • Loading branch information
weiliw-amz authored Dec 10, 2022
1 parent 8f648b9 commit aad94c6
Show file tree
Hide file tree
Showing 2 changed files with 218 additions and 157 deletions.
4 changes: 2 additions & 2 deletions pecos/core/utils/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace pecos {
csr_t res;
res.allocate(rows, cols, nnz);
std::memcpy(res.col_idx, col_idx, sizeof(index_type) * nnz);
std::memcpy(res.val, val, sizeof(float) * nnz);
std::memcpy(res.val, val, sizeof(value_type) * nnz);
std::memcpy(res.row_ptr, row_ptr, sizeof(mem_index_type) * (rows + 1));
return res;
}
Expand Down Expand Up @@ -386,7 +386,7 @@ namespace pecos {
csc_t res;
res.allocate(rows, cols, nnz);
std::memcpy(res.row_idx, row_idx, sizeof(index_type) * nnz);
std::memcpy(res.val, val, sizeof(float) * nnz);
std::memcpy(res.val, val, sizeof(value_type) * nnz);
std::memcpy(res.col_ptr, col_ptr, sizeof(mem_index_type) * (cols + 1));
return res;
}
Expand Down
Loading

0 comments on commit aad94c6

Please sign in to comment.