Skip to main content

Cross-platform CPU feature detection as a frozenset of enum flags for SIMD backend selection.

Project description

goblin-cpu-features

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

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:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goblin_cpu_features-0.1.0.tar.gz (24.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

goblin_cpu_features-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl (173.3 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.4 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

goblin_cpu_features-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl (173.4 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

goblin_cpu_features-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl (173.4 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

goblin_cpu_features-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl (173.6 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

goblin_cpu_features-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (173.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

goblin_cpu_features-0.1.0-cp39-cp39-musllinux_1_2_x86_64.whl (173.1 kB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

goblin_cpu_features-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (74.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file goblin_cpu_features-0.1.0.tar.gz.

File metadata

  • Download URL: goblin_cpu_features-0.1.0.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for goblin_cpu_features-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daaa5b09f40b0eecc17cb083f8ff13c968793458d82dc009fbc38f90c05444ff
MD5 37745bbb946d83adfe74cd4536584c21
BLAKE2b-256 84f2c8638ce99b79aef8143f8a747e2e32897f717451d6c0f936bce60810ddc6

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f75d42a61cd5c4c8a6ae57d283ec42b7a55c5a71f04d290e657d643d2aa14a68
MD5 7760da6fe83da8cc3cbebead33daa599
BLAKE2b-256 9e0c627a53f3cbe3e0948731ca71088bec123590ad71ef04f741031dc05f1d55

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5dd9e2e36b99a57c7145ec803f9d967eec27f4dd761ea762d5e278cc8f6542c4
MD5 87d3ba1b7742d39ba6cb4d42c5b4e1d8
BLAKE2b-256 b3655d78e847be31fd902ae6e6c4861435dca06cd30d651c916318286a0054ee

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26d0c6bbac10f931928b4575110efa6ff909bd0e4ef6c79c82738b8376e94e4f
MD5 fe2d96137835bdf6edf436497c22b4a8
BLAKE2b-256 8fa47d5c0653aeffa50547f70f8e2818ad5ee15be75346da4126a24827500afb

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c83295893b543c05c4c7f92177017997fb9ce9dc19131d4613af0179a54eb68
MD5 10a03a703d5d079791f09a3f43c3a087
BLAKE2b-256 057a261294b7d35e71212fa66cdf4ce2b0d3d015294507b8da7e24edf6b5b273

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 403403246f902c66a858800b10523b66fbdae151163c80a5eef06639147df38e
MD5 0d34f89315bf50c61eeff91ac2801426
BLAKE2b-256 2450dae52409f6eea2f44047a7a81c9cf0bb418756ea840867483627a8a3eca2

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0679b6a09a5680948a06228d0a81f1fd545404cfb4f8f973d41706c130c21f8f
MD5 4db60fb2d35b7c95e561b52c86038a5a
BLAKE2b-256 516dd8731cb6fa3ee8820549b01f63493a81826473c994cee2ee89311c77ca4f

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 739a5d4695db9ab8e2dd4cb0443596620fee0bb603955730b09e57dd608e5b2e
MD5 51c2c723124d3ad381141e8b7ac7449e
BLAKE2b-256 836b03aace914ac267ce1943444b82ad2237e19394491ab8d88ce0389a02e70b

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 788eb203ae54b2eac9fe042064158594f16c0f16a3e56ce237e3a8c68a4ec8b8
MD5 48947982a7495834afc4268b993b94a0
BLAKE2b-256 9531195bb9bf55088409be5b7cb9d11d288c15e48de7e8d45d560e55717e381f

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1e80f42c15455911423578432bb00898052bf583d105b89b4de64196a1e4d416
MD5 b4cdd5714d1ea26a2deefaaa1bf39350
BLAKE2b-256 58364388870bbd169c7f97af4872e84f02b53603c94132a1d60bd6130959674d

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b9b791b1a1a709f16f394ded32181d728a7aba3dc6980305a3babd9de83c573
MD5 0bb1973164db59758df2e3d9b8637a8d
BLAKE2b-256 f1800a861c15322ec16b7659e378d0d5595d299cbc361ca754b655cb9d89ab9e

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c0c24749d301af6e20422a5277ca59722fec09f919e3d301478ca97758d5059f
MD5 4b6770ccc4ee1efe39d2f16bbe7a6288
BLAKE2b-256 cf7f53e65cd92a7e0d97358f414e99545267c6d743a338e259ebeefed79da35d

See more details on using hashes here.

File details

Details for the file goblin_cpu_features-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for goblin_cpu_features-0.1.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0fdbf92b0a0702a81b0e655d3521936c4e81b189ffffc2ca3f96e5e511a6856
MD5 ba75b689a8bca29e5a0ffa874ec6cfab
BLAKE2b-256 fbaa8515d57ba3c16e7066e4ef209566043e76f6eb6bfe58c0011f96d6b76b6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page