Skip to content

Commit 930e22a

Browse files
switch to ensure_simd and update readme
1 parent 48956af commit 930e22a

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Upcoming
4+
- switch to `ensure_simd`
5+
36
## 4.2.0
47
- Perf: improve NEON codegen by avoiding `u32x8::splat`.
58
- Perf: reuse thread-local allocations between invocations

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ description = "Constructing and iterating packed DNA sequences using SIMD"
1313
wide = "0.7"
1414
mem_dbg = "0.3"
1515
cfg-if = "1.0"
16+
ensure_simd = "0.1.0"
1617

1718
# Optional generate random sequences for testing. (Default enabled.)
1819
rand = { version = "0.9", features = ["small_rng"], optional = true }
@@ -28,4 +29,4 @@ pyo3 = { version = "0.25", features = ["extension-module"], optional = true }
2829
default = ["rand"]
2930

3031
# Hides the `simd` warnings when neither AVX2 nor NEON is detected.
31-
scalar = []
32+
scalar = ["ensure_simd/scalar"]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ crate was developed:
2121
Ragnar Groot Koerkamp, Igor Martayan.
2222
SEA 2025 [https://doi.org/10.4230/LIPIcs.SEA.2025.20](doi.org/10.4230/LIPIcs.SEA.2025.20)
2323

24-
## Requirements
24+
## Installation
2525

26-
This library supports AVX2 and NEON instruction sets.
27-
Make sure to set `RUSTFLAGS="-C target-cpu=native"` when compiling to use the instruction sets available on your architecture.
26+
This library requires AVX2 or NEON instruction sets, which, on x64, requires
27+
either `target-cpu=native` or `target-cpu=x86-64-v3`.
28+
See [this README](https://github.com/ragnargrootkoerkamp/ensure_simd) for details and [this
29+
blog](https://curiouscoding.nl/posts/distributing-rust-simd-binaries/) for background.
30+
The same restrictions apply when using packed-seq in a larger project.
2831

2932
``` sh
3033
RUSTFLAGS="-C target-cpu=native" cargo run --release
3134
```
3235

33-
Enable the `-F scalar` feature flag to fall back to a scalar implementation with
34-
reduced performance.
35-
3636
## Usage example
3737

3838
Full documentation can be found on [docs.rs](https://docs.rs/packed-seq).

src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,6 @@
105105
//! - `epserde` enables `derive(epserde::Epserde)` for `PackedSeqVec` and `AsciiSeqVec`, and adds its `SerializeInner` and `DeserializeInner` traits to `SeqVec`.
106106
//! - `pyo3` enables `derive(pyo3::pyclass)` for `PackedSeqVec` and `AsciiSeqVec`.
107107
108-
#[cfg(not(any(
109-
doc,
110-
debug_assertions,
111-
target_feature = "avx2",
112-
target_feature = "neon",
113-
feature = "scalar"
114-
)))]
115-
compile_error!(
116-
"Packed-seq uses AVX2 or NEON SIMD instructions. Compile using `-C target-cpu=native` to get the expected performance. Silence this error using the `scalar` feature."
117-
);
118-
119108
/// Functions with architecture-specific implementations.
120109
pub mod intrinsics {
121110
mod transpose;

0 commit comments

Comments
 (0)