| Crates.io | poulpy-cpu-avx |
| lib.rs | poulpy-cpu-avx |
| version | 0.1.1 |
| created_at | 2025-11-19 16:16:43.568191+00 |
| updated_at | 2025-11-21 16:37:43.067654+00 |
| description | A crate providing concrete AVX accelerated CPU implementations of poulpy-hal through its open extension points |
| homepage | https://github.com/phantomzone-org/poulpy |
| repository | https://github.com/phantomzone-org/poulpy |
| max_upload_size | |
| id | 1940375 |
| size | 235,057 |
Poulpy-CPU-AVX is a Rust crate that provides an AVX2 + FMA accelerated CPU backend for Poulpy.
This backend implements the Poulpy HAL extension traits and can be used by:
To avoid illegal hardware instructions (SIGILL) on unsupported CPUs, this backend is opt-in and only builds when explicitly requested.
| Requirement | Status |
|---|---|
| Cargo feature flag | --features enable-avx must be enabled |
| CPU architecture | x86_64 |
| CPU target features | AVX2 + FMA |
If enable-avx is enabled but the target does not provide these capabilities, the build fails immediately with a clear error message, rather than generating invalid binaries.
When enable-avx is not enabled, this crate is simply skipped and Poulpy automatically falls back to the portable poulpy-cpu-ref backend. This ensure that Poulpy's workspace remains portable (e.g. for macOS ARM).
Because the compiler must generate AVX2 + FMA instructions, both the Cargo feature and CPU target flags must be specified:
RUSTFLAGS="-C target-feature=+avx2,+fma" \
cargo build --features enable-avx
RUSTFLAGS="-C target-feature=+avx2,+fma" \
cargo run --example <name> --features enable-avx
RUSTFLAGS="-C target-feature=+avx2,+fma" \
cargo bench --features enable-avx
use poulpy_backend_cpu_avx::FFT64Avx;
use poulpy_hal::{api::ModuleNew, layouts::Module};
let log_n: usize = 10;
let module = Module<FFT64Avx> = Module<FFT64Avx>::new(1<<log_n);
Once compiled with enable-avx, the backend is usable transparently anywhere Poulpy expects a backend type (poulpy-hal, poulpy-core, poulpy-schemes).
To implement your own Poulpy backend (SIMD or accelerator):
poulpy-hal/oepBackend traitYour backend will automatically integrate with:
poulpy-halpoulpy-corepoulpy-schemesNo modifications to those crates are required — the HAL provides the extension points.
For questions or guidance, feel free to open an issue or discussion in the repository.