diff --git a/Cargo.toml b/Cargo.toml index 1a7abfd..87be3d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,16 @@ description = "Fast integer compression/decompression via SIMD bit-packing. Port crunchy = "0.2.2" [dev-dependencies] -rand = "0.6" +rand = "0.7" criterion = "0.2" +[features] +bitpacker1x = [] +bitpacker4x = [] +bitpacker8x = [] + +default = ["bitpacker1x", "bitpacker4x", "bitpacker8x", ] + [[bench]] name = "bitpacking_bench" path = "src/bitpacking_bench.rs" diff --git a/src/lib.rs b/src/lib.rs index 6fa3e4d..0617baa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -264,10 +264,16 @@ fn most_significant_bit(v: u32) -> u8 { } } +#[cfg(feature = "bitpacker1x")] mod bitpacker1x; +#[cfg(feature = "bitpacker4x")] mod bitpacker4x; +#[cfg(feature = "bitpacker8x")] mod bitpacker8x; +#[cfg(feature = "bitpacker1x")] pub use bitpacker1x::BitPacker1x; +#[cfg(feature = "bitpacker4x")] pub use bitpacker4x::BitPacker4x; +#[cfg(feature = "bitpacker8x")] pub use bitpacker8x::BitPacker8x;