I can't set AVX2 and then read it through. This command just doesn't work.
#[cfg(target_feature = "+avx2")]
const CHUNK_SIZE: usize = 4;
Here is an example of my Cargo.toml file:
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
target-feature = "+avx2"
target-cpu = "x86-64-v4"
RUSTFLAGS = "-C target-cpu=x86-64-v4 -C target-feature=+avx2"
[build]
rustflags = ["target-feature", "+avx2"]
The compilation looks like this:
cargo bench --verbose
rustc --crate-name tsrs --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=154 --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=1 --test -C metadata=d359a2008d8c28b7 -C extra-filename=-d359a2008d8c28b7 --out-dir /home/hexen/Projects/tsrs/target/release/deps -C strip=symbols -L dependency=/home/hexen/Projects/tsrs/target/release/deps --extern rand=/home/hexen/Projects/tsrs/target/release/deps/librand-1b509dcebceec914.rlib
rustc 1.77.1-nightly (7cf61ebde 2024-03-27) (gentoo)
binary: rustc
commit-hash: 7cf61ebde7b22796c69757901dd346d0fe70bd97
commit-date: 2024-03-27
host: x86_64-unknown-linux-gnu
release: 1.77.1-nightly
LLVM version: 17.0.6