Skip to main content

Crate libcpuname

Crate libcpuname 

Source
Expand description

Identify CPU vendors, chips, and cores.

Provides lookup tables for the names of CPU manufacturers and designers, CPU chip designs, and CPU core microarchitectures. The following instruction set architectures are supported:

  • x86 (both 32-bit and 64-bit CPUs)
  • ARM
  • RISC-V

§Quickstart

Add libcpuname to your project as a dependency:

cargo add libcpuname

§Features

The module corresponding to the host’s target architecture is enabled by default via the native feature. Other architectures can be enabled individually or wholesale. The following features are available:

  • std (enabled by default): Link against the std crate. This enables impls of std::error::Error
  • native (enabled by default): Exposes the module that matches the host’s target triple
  • arm: Exposes the arm module
  • riscv: Exposes the riscv module
  • x86: Exposes the x86 module

Modules§

arm
Lookup functions for ARM CPUs.
riscv
Lookup functions for RISC-V CPUs.
x86
Lookup functions for x86 and x86-64 CPUs.