Metadata-Version: 2.4
Name: goblin-cpu-features
Version: 0.1.0
Summary: Cross-platform CPU feature detection as a frozenset of enum flags for SIMD backend selection.
Keywords: cpu,simd,features,cpuid,avx,neon,sve,rvv
Author: Adam DePrince
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: SunOS/Solaris
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: C++
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Hardware
Project-URL: Homepage, https://github.com/adeprince/goblin-cpu-features
Requires-Python: <3.15,>=3.9
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: cmake>=3.26; extra == "dev"
Requires-Dist: cibuildwheel>=3.0; extra == "dev"
Requires-Dist: ninja>=1.11; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Description-Content-Type: text/markdown

# goblin-cpu-features

Cross-platform CPU feature detection for packages that choose their own SIMD
backend at import time.

```python
import goblin_cpu_features as cpu

features = cpu.detect()
if {cpu.Feature.X86_AVX2, cpu.Feature.X86_FMA}.issubset(features):
    from mypkg import _avx2 as impl
elif cpu.Feature.ARM_SVE2 in features:
    from mypkg import _sve2 as impl
else:
    from mypkg import _generic as impl
```

`goblin_cpu_features` only reports host CPU features. It does not choose or
import application backends.

## Build

Local x86_64 manylinux and musllinux wheels are configured for Podman through
cibuildwheel:

```sh
python -m pip install '.[dev]'
python -m cibuildwheel --platform linux --output-dir wheelhouse .
```

The configured x86_64 build set is CPython 3.9 through 3.14 for both
`manylinux_x86_64` and `musllinux_x86_64`.

On non-x86 targets with pyenv-hosted interpreters, build one native wheel per
interpreter from the target environment:

```sh
for minor in 3.9 3.10 3.11 3.12 3.13 3.14; do
  for py in "$HOME"/.pyenv/versions/"$minor".*/bin/python; do
    [ -x "$py" ] || continue
    "$py" -m pip wheel --no-deps -w wheelhouse .
  done
done
```

For manylinux or musllinux tags on those targets, run the pyenv build inside
the corresponding compliant build environment or repair/tag the wheels using
the target platform's normal wheel policy tooling.
# goblin-cpu-features
