-
Notifications
You must be signed in to change notification settings - Fork 47
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
Matrix transpose bitorder #27
Conversation
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.
ack 👍
fn transpose_naive(data: &[u8], row_width: usize) -> Vec<u8> { | ||
use itybity::*; | ||
|
||
let bits: Vec<Vec<bool>> = data.chunks(row_width).map(|x| x.to_lsb0_vec()).collect(); |
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.
isn't row_width
the width in bits ? here it is treated as if it was in bytes
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.
I think it is correct here to use the row width in bytes, because we iterate in chunks of byte rows and turn this chunk into bit rows. So in the beginning it is bytes and after this operation it is bits.
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.
some tests seem to be failing
Is there an easy way to test the "simd-transpose" feature from command line? I couldnt find one.
Maybe we should have our CI to also run the tests with "simd-transpose" enabled?
I don't see any failing tests, try |
I'm going to merge this, it is blocking #37. Changes to CI etc can be done in another PR |
* add naive test * Change algorithm to work for LSB0 encoding instead of MSB0 * add test --------- Co-authored-by: th4s <[email protected]> Co-authored-by: themighty1 <[email protected]>
* add naive test * Change algorithm to work for LSB0 encoding instead of MSB0 * add test --------- Co-authored-by: th4s <[email protected]> Co-authored-by: themighty1 <[email protected]>
This PR flips the bit order of the resulting transposed matrix