Skip to content

Commit 091df20

Browse files
jhorstmannjorgecarleitao
authored andcommitted
ARROW-10914: [Rust] Refactor simd arithmetic kernels to use chunked iteration
This should avoid out of bounds reads in those kernels and also removes some unsafe blocks. The performance actually seems to increase slightly, I will post the numbers later. The division kernel looks a bit more complex now, but follows the same pattern as used in the simd aggregation functions, with two separate codepaths for the nullable/non-null cases. The comparison kernels might also do some out of bounds reads, I will look at those in a separate ticket/PR. Closes #8929 from jhorstmann/ARROW-10914-simd-arithmetic-read-out-of-bounds Authored-by: Jörn Horstmann <[email protected]> Signed-off-by: Jorge C. Leitao <[email protected]>
1 parent 5819943 commit 091df20

File tree

3 files changed

+254
-196
lines changed

3 files changed

+254
-196
lines changed

rust/arrow/src/buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ impl MutableBuffer {
824824
}
825825

826826
/// View buffer as typed slice.
827-
pub fn typed_data_mut<T: ArrowNativeType + num::Num>(&mut self) -> &mut [T] {
827+
pub fn typed_data_mut<T: ArrowNativeType>(&mut self) -> &mut [T] {
828828
assert_eq!(self.len() % mem::size_of::<T>(), 0);
829829
assert!(memory::is_ptr_aligned::<T>(self.raw_data() as *const T));
830830
unsafe {

0 commit comments

Comments
 (0)