polars_compute/
lib.rs

1#![cfg_attr(feature = "simd", feature(portable_simd))]
2
3use arrow::types::NativeType;
4
5pub mod arithmetic;
6pub mod arity;
7pub mod binview_index_map;
8pub mod bitwise;
9#[cfg(feature = "approx_unique")]
10pub mod cardinality;
11#[cfg(feature = "cast")]
12pub mod cast;
13pub mod comparisons;
14pub mod filter;
15#[cfg(feature = "cast")]
16pub mod find_validity_mismatch;
17pub mod float_sum;
18#[cfg(feature = "gather")]
19pub mod gather;
20pub mod horizontal_flatten;
21#[cfg(feature = "approx_unique")]
22pub mod hyperloglogplus;
23pub mod if_then_else;
24pub mod min_max;
25pub mod moment;
26pub mod propagate_dictionary;
27pub mod propagate_nulls;
28pub mod rolling;
29pub mod size;
30pub mod sum;
31pub mod trim_lists_to_normalized_offsets;
32pub mod unique;
33
34// Trait to enable the scalar blanket implementation.
35pub trait NotSimdPrimitive: NativeType {}
36
37#[cfg(not(feature = "simd"))]
38impl<T: NativeType> NotSimdPrimitive for T {}
39
40#[cfg(feature = "simd")]
41impl NotSimdPrimitive for u128 {}
42#[cfg(feature = "simd")]
43impl NotSimdPrimitive for i128 {}
44
45// Trait to allow blanket impl for all SIMD types when simd is enabled.
46#[cfg(feature = "simd")]
47mod _simd_primitive {
48    use std::simd::SimdElement;
49    pub trait SimdPrimitive: SimdElement {}
50    impl SimdPrimitive for u8 {}
51    impl SimdPrimitive for u16 {}
52    impl SimdPrimitive for u32 {}
53    impl SimdPrimitive for u64 {}
54    impl SimdPrimitive for usize {}
55    impl SimdPrimitive for i8 {}
56    impl SimdPrimitive for i16 {}
57    impl SimdPrimitive for i32 {}
58    impl SimdPrimitive for i64 {}
59    impl SimdPrimitive for isize {}
60    impl SimdPrimitive for f32 {}
61    impl SimdPrimitive for f64 {}
62}
63
64#[cfg(feature = "simd")]
65pub use _simd_primitive::SimdPrimitive;