You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Rust] simd_compare_op creates buffer of incorrect length when item count is not a multiple of T::lanes() #24763
appears to only work correctly when item count is a multiple of T::lanes().
Otherwise the resulting boolean array is created with a buffer of incorrect length and subsequent binary operations such as compute::and return an error.
The no_simd_compare_op function defined in the same module does not appear to have this problem.
This bug can be reproduced with the following code:
fnmain() {
letlanes = Int8Type::lanes();
println("i8 lanes: {}", lanes); // 64// let item_count = 128; // this works because item_count divides by 64 (lanes) without remainderletitem_count = 130; // this fails because item_count divides by 64 (lanes) with remainder// item_count = 130 should return error:// ComputeError("Buffers must be the same size to apply Bitwise AND.") // create boolean arrayletmutselect_mask: BooleanArray = vec![true; item_count].into();
// create arrays with i8 valuesletvalue_array: PrimitiveArray<Int8Type> = vec![1; item_count].into();
letfilter_array: PrimitiveArray<Int8Type> = vec![2; item_count].into();
// compare i8 arrays and produce a boolean arrayletresult_mask = compute::gt_eq(&value_array, &filter_array).unwrap();
// compare boolean arraysselect_mask = compute::and(&select_mask, &result_mask).unwrap();
// print result, should be all falseprintln!("select mask: {:?}", select_mask);
}
Activity
asfimport commentedon Apr 28, 2020
Paddy Horan / @paddyhoran:
Issue resolved by pull request 7043
#7043