google/highway
Performance-portable, length-agnostic SIMD with runtime dispatch
What it solves
Highway solves the problem of writing high-performance, hardware-accelerated code that works across many different CPU architectures. Traditionally, developers must write separate, complex code for each CPU type (like x86, Arm, or RISC-V) to use SIMD (Single Instruction, Multiple Data) instructions. Highway provides a unified interface that allows the same code to run efficiently on all these platforms.
How it works
Highway is a C++ library that provides portable SIMD intrinsics. It acts as an abstraction layer over CPU-specific vector instructions. Developers write their algorithms using Highway's set of functions, and the library handles the mapping to the specific instructions available on the host CPU. It supports both static dispatch (targeting one instruction set at compile time) and dynamic dispatch (detecting the best available instruction set at runtime to maximize performance on any device).
Who it’s for
This library is for software engineers and performance-focused developers working on compute-intensive applications such as image/video processing, cryptography, linear algebra, and machine learning inference. It is ideal for those who need to squeeze maximum performance out of hardware without maintaining multiple, platform-specific codebases.
Highlights
- Performance Portability: Write code once and run it across seven different CPU architectures, including x86, Arm, RISC-V, and WebAssembly.
- Runtime Dispatch: Automatically selects the most efficient instruction set available on the user's hardware at runtime.
- Scalable Vectors: Designed to support scalable vector lengths, making it future-proof as new hardware introduces wider vector registers.
- Broad Adoption: Used in major projects including Chromium, TensorFlow, JPEG XL, and various machine learning inference engines like gemma.cpp.
Related
- Project
- Project
- Project