Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Bump multiversion to 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
aldanor committed Dec 24, 2022
1 parent c6449e1 commit 63407db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ serde_json = { version = "^1.0", features = ["preserve_order"], optional = true
strength_reduce = { version = "0.2", optional = true }

# For instruction multiversioning
multiversion = { version = "0.6.1", optional = true }
multiversion = { version = "0.7", optional = true }

# For support for odbc
odbc-api = { version = "0.36", optional = true }
Expand Down
6 changes: 2 additions & 4 deletions src/compute/aggregate/sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ pub trait Sum<T> {
fn simd_sum(self) -> T;
}

#[multiversion]
#[clone(target = "x86_64+avx")]
#[multiversion(targets("x86_64+avx"))]
fn nonnull_sum<T>(values: &[T]) -> T
where
T: NativeType + Simd + Add<Output = T> + std::iter::Sum<T>,
Expand All @@ -39,8 +38,7 @@ where

/// # Panics
/// iff `values.len() != bitmap.len()` or the operation overflows.
#[multiversion]
#[clone(target = "x86_64+avx")]
#[multiversion(targets("x86_64+avx"))]
fn null_sum_impl<T, I>(values: &[T], mut validity_masks: I) -> T
where
T: NativeType + Simd,
Expand Down
9 changes: 3 additions & 6 deletions src/compute/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ use crate::{

use super::arity::unary;

#[multiversion]
#[clone(target = "x86_64+aes+sse3+ssse3+avx+avx2")]
#[multiversion(targets("x86_64+aes+sse3+ssse3+avx+avx2"))]
/// Element-wise hash of a [`PrimitiveArray`]. Validity is preserved.
pub fn hash_primitive<T: NativeType + Hash>(array: &PrimitiveArray<T>) -> PrimitiveArray<u64> {
let state = new_state!();

unary(array, |x| state.hash_one(x), DataType::UInt64)
}

#[multiversion]
#[clone(target = "x86_64+aes+sse3+ssse3+avx+avx2")]
#[multiversion(targets("x86_64+aes+sse3+ssse3+avx+avx2"))]
/// Element-wise hash of a [`BooleanArray`]. Validity is preserved.
pub fn hash_boolean(array: &BooleanArray) -> PrimitiveArray<u64> {
let state = new_state!();
Expand All @@ -45,8 +43,7 @@ pub fn hash_boolean(array: &BooleanArray) -> PrimitiveArray<u64> {
PrimitiveArray::<u64>::new(DataType::UInt64, values, array.validity().cloned())
}

#[multiversion]
#[clone(target = "x86_64+aes+sse3+ssse3+avx+avx2")]
#[multiversion(targets("x86_64+aes+sse3+ssse3+avx+avx2"))]
/// Element-wise hash of a [`Utf8Array`]. Validity is preserved.
pub fn hash_utf8<O: Offset>(array: &Utf8Array<O>) -> PrimitiveArray<u64> {
let state = new_state!();
Expand Down

0 comments on commit 63407db

Please sign in to comment.