Support auto-vectorization for min/max using multiversion (#9)
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 @@
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 @@
}
/// 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,