You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2021/04/23 07:59:42 UTC
[arrow-rs] branch master updated: Support auto-vectorization for
min/max using multiversion (#9)
This is an automated email from the ASF dual-hosted git repository.
jorgecarleitao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 463f88f Support auto-vectorization for min/max using multiversion (#9)
463f88f is described below
commit 463f88f5553a51a0498658bdc5a0ba13a2e24eda
Author: Daniƫl Heres <da...@gmail.com>
AuthorDate: Fri Apr 23 09:59:34 2021 +0200
Support auto-vectorization for min/max using multiversion (#9)
---
arrow/Cargo.toml | 1 +
arrow/src/compute/kernels/aggregate.rs | 3 +++
2 files changed, 4 insertions(+)
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index 2346ced..f23217b 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -51,6 +51,7 @@ flatbuffers = "^0.8"
hex = "0.4"
prettytable-rs = { version = "0.8.0", optional = true }
lexical-core = "^0.7"
+multiversion = "0.6.1"
[features]
default = []
diff --git a/arrow/src/compute/kernels/aggregate.rs b/arrow/src/compute/kernels/aggregate.rs
index d0e3f22..a01b29e 100644
--- a/arrow/src/compute/kernels/aggregate.rs
+++ b/arrow/src/compute/kernels/aggregate.rs
@@ -17,6 +17,7 @@
//! Defines aggregations over Arrow arrays.
+use multiversion::multiversion;
use std::ops::Add;
use crate::array::{
@@ -103,6 +104,8 @@ pub fn min_string<T: StringOffsetSizeTrait>(
}
/// Helper function to perform min/max lambda function on values from a numeric array.
+#[multiversion]
+#[clone(target = "x86_64+avx")]
fn min_max_helper<T, F>(array: &PrimitiveArray<T>, cmp: F) -> Option<T::Native>
where
T: ArrowNumericType,