# google/cpu_features

A cross platform C99 library to get cpu features at runtime.

Repository: https://github.com/google/cpu_features
Canonical: https://ross.abutalabs.com/products/cpu_features
Language: C++
License: Apache-2.0
License Family: permissive
Topics: cpu-features, cpu, cross-platform, microarchitecture
Last push: 2026-07-20T12:30:47+00:00

## Health v2 (maintenance only)
Score: 81/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 93, release rhythm 54, longevity 100
- inputs: {"age_days": 3136, "days_push": 44, "days_rel": 93, "gap_med": 197.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2618, forks 305 (observed 2026-08-28T04:07:04.708706+00:00)

## What it is
A cross-platform C99 library from Google for detecting CPU features (like available instruction sets) at runtime. It supports many architectures including x86/amd64, AArch64, ARM, MIPS, POWER, RISC-V, and s390x.

## Use cases
- detect cpu instruction set support at runtime
- check if simd extensions like avx2 or neon are available
- write portable code that dispatches to optimized code paths per cpu
- query cpu microarchitecture and cache info in c or c++
- avoid illegal instruction crashes on older cpus

## When to choose
- you need reliable runtime CPU feature detection across many architectures and operating systems
- you are writing performance-critical C/C++ code with multiple optimized code paths
- you want a small, well-tested, Apache-2.0 licensed C library maintained by Google

## When to avoid
- you only target a single fixed CPU architecture and can rely on compile-time flags
- you need GPU or accelerator capability detection rather than CPU features
- you work in a language ecosystem with its own built-in CPUID facilities

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, hardware, cross-platform
- platform: windows, cpp, c
- tags: cpu-features, runtime-detection, c99, microarchitecture, instruction-set, simd, cross-platform, linux, macos

## Member repositories
- google/cpu_features (main) score 81

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:04.708706+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:20:22.497304+00:00, confidence not recorded.
  - readme: https://github.com/google/cpu_features (fetched 2026-08-28T04:07:04.708706+00:00, sha 53ead11924f4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
