Skip to content
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

Fix bitmask creation also for simd comparisons with scalar #1290

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ where
let simd_result = simd_op(simd_left, simd_right);

let m = T::mask_to_u64(&simd_result);
bitmask |= m << (i / lanes);
bitmask |= m << i;

i += lanes;
}
Expand Down Expand Up @@ -2478,6 +2478,18 @@ mod tests {
let a = Int64Array::from($A_VEC);
let c = $KERNEL(&a, $B).unwrap();
assert_eq!(BooleanArray::from($EXPECTED), c);

// test with a larger version of the same data to ensure we cover the chunked part of the comparison
let mut a = vec![];
let mut e = vec![];
for _i in 0..10 {
a.extend($A_VEC);
e.extend($EXPECTED);
}
let a = Int64Array::from(a);
let c = $KERNEL(&a, $B).unwrap();
assert_eq!(BooleanArray::from(e), c);

};
}

Expand Down