Skip to content

Commit

Permalink
Merge pull request #16 from fdb-hiroshima/feature/optional-compilation
Browse files Browse the repository at this point in the history
Feature/optional compilation
  • Loading branch information
fulmicoton authored Jul 10, 2019
2 parents d89310e + 742a704 commit 2f0bc34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 2f0bc34

Please sign in to comment.