Description
Performance profiling revealed the crate was spending 50% of its time inside libm.so
, and I decided to try using sleef
to see if it would help. Unfortunately, it seemed it wasn't working, and the crate was still using libm
's functions.
The benchmark's README recommends building with target-cpu=native
. However, sleef-sys
has a build file which checks for the presence of certain target-features
, and ignores target-cpu
.
So I kept target-cpu=native
, and also added -C target-feature=sse,sse2,ssse3,sse4.1,avx,avx2,fma
(all of my CPU's features, I think).
But then it failed to build:
error[E0463]: can't find crate for `sleef_sys`
--> /data/Development/Rust/packed_simd/src/lib.rs:261:1
|
261 | extern crate sleef_sys;
| ^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
It seems the cfg(all(target_feature = "sse2"))
in packed_simd
's Cargo.toml
wasn't working. So I removed it and now it tried to build libsleef.so
:
unsupported target: "x86_64-unknown-linux-gnu" features: "{"rdrand", "popcnt", "lzcnt", "xsaveopt", "xsavec", "rdseed", "bmi2", "xsave", "bmi1", "fxsr", "xsaves", "mmx"}"
So what are the step-by-step instructions for using sleef
with this crate?