Skip to content

About

A provider plugin for x86_64 architecture

Resources

Stars

1 star

Watchers

3 watching

Forks

Repository files navigation

x86_64-variant-provider

This is a plugin for the proposed wheel variants implementation that provides properties specific to x86-64 CPUs.

Usage

Namespace: x86_64

Plugin API: x86_64_variant_provider (matching the default)

Example use in pyproject.toml:

[variant.providers.x86_64]
requires = ["x86_64-variant-provider"]

Provided properties

To obtain the full list of properties supported by a given plugin version, install it, then use:

variantlib plugins get-configs -a -n x86_64

To obtain the full list of properties compatible with your system, use:

variantlib plugins get-configs -s -n x86_64

x86_64 :: level

Values: v1, v2...

Specifies the targeted microarchitecture level. The plugin automatically adds appropriate -march= value to CFLAGS. The resulting wheel will be incompatible with CPUs below the specified microarchitecture level.

x86_64 :: <extension>

Feature names: aes, avx2, sse4_1...

Values: on

Specifies that the built wheel uses the specific CPU extension. The plugin does not emit any compiler flags at the moment. The resulting wheel will be incompatible with CPUs that do not implement the specific extension.

Note that while these properties are independent of microarchitecture levels, there is little purpose in specifying them if the wheel already specifies a microarchitecture level requiring a specific extension.

These properties should only be used when the relevant intrinsics are used unconditionally. If the code using them uses runtime detection, they should not be specified, as they will prevent installing the wheel on systems where the extension is not available (yet the code would work fine, disabling the code in question).

Detection

Detection is backed by archspec and shared between x86_64-variant-provider and aarch64-variant-provider. The output from each command is mapped against the archspec microarchitecture database to emit the actual feature.

OS Detection method
Linux Read vendor_id and flags from the first CPU entry in /proc/cpuinfo.
macOS Run sysctl in a subprocess and parse machdep.cpu.vendor, machdep.cpu.features, machdep.cpu.leaf7_features, and machdep.cpu.extfeatures.
Windows Execute the CPUID instruction and decode its registers using cpuid.json.

About

A provider plugin for x86_64 architecture

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages