-
Notifications
You must be signed in to change notification settings - Fork 99
Improved CSR-to-COO conversion #1832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: transform_iterator
Are you sure you want to change the base?
Conversation
0f06710
to
f0c5d97
Compare
2d05e9f
to
2d1113a
Compare
2d1113a
to
0f03ce2
Compare
34f6a8c
to
a94c5a8
Compare
0f03ce2
to
867c39a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
const RowPtrType* ptrs, size_type num_blocks, | ||
IndexType* idxs) | ||
{ | ||
const auto num_elements = exec->copy_val_to_host(ptrs + num_blocks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we just paste the idxs size from outside. We should have it already when allocating the idxs array
{ | ||
const auto num_elements = exec->copy_val_to_host(ptrs + num_blocks); | ||
// transform the ptrs to a bitvector in unary delta encoding, i.e. | ||
// every row with n elements is encoded as 1 0 ... n times ... 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// every row with n elements is encoded as 1 0 ... n times ... 0 | |
// every row with n elements is encoded as 1 0 ... n times ... 0 | |
// we only process the value when bv is zero, the prefix-sum of bv - 1, which is get_rank() - 1, is the row index. |
This conversion can suffer from load imbalance in imbalanced matrices, this new algorithm is always perfectly load-balanced.