Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-compute/src/lib.rs
6939 views
1
#![cfg_attr(feature = "simd", feature(portable_simd))]
2
3
use arrow::types::NativeType;
4
5
pub mod arithmetic;
6
pub mod arity;
7
pub mod binview_index_map;
8
pub mod bitwise;
9
#[cfg(feature = "approx_unique")]
10
pub mod cardinality;
11
#[cfg(feature = "cast")]
12
pub mod cast;
13
pub mod comparisons;
14
pub mod filter;
15
#[cfg(feature = "cast")]
16
pub mod find_validity_mismatch;
17
pub mod float_sum;
18
#[cfg(feature = "gather")]
19
pub mod gather;
20
pub mod horizontal_flatten;
21
#[cfg(feature = "approx_unique")]
22
pub mod hyperloglogplus;
23
pub mod if_then_else;
24
pub mod min_max;
25
pub mod moment;
26
pub mod propagate_dictionary;
27
pub mod propagate_nulls;
28
pub mod rolling;
29
pub mod size;
30
pub mod sum;
31
pub mod trim_lists_to_normalized_offsets;
32
pub mod unique;
33
34
// Trait to enable the scalar blanket implementation.
35
pub trait NotSimdPrimitive: NativeType {}
36
37
#[cfg(not(feature = "simd"))]
38
impl<T: NativeType> NotSimdPrimitive for T {}
39
40
#[cfg(feature = "simd")]
41
impl NotSimdPrimitive for u128 {}
42
#[cfg(feature = "simd")]
43
impl NotSimdPrimitive for i128 {}
44
45
// Trait to allow blanket impl for all SIMD types when simd is enabled.
46
#[cfg(feature = "simd")]
47
mod _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")]
65
pub use _simd_primitive::SimdPrimitive;
66
67