Google Rolls Out cpu_features Library
Google's cpu_features library makes it easier for detecting modern CPU capabilities like FMA, SSE, and AVX extensions when writing hand-tuned code.
While there is /proc/cpuinfo for parsing CPU instruction set extensions and various other means of determining a processor's features, the new cpu_features library from Google is designed to be very portable, support different CPU architectures and operating systems, and can be used practically anywhere.
This library supports x86, ARM, ARM64 / AArch64, and MIPS processors currently and reports available CPU features. The library is written in C89 for making it portable as possible. This library also supports caching of results, checking compile time flags, and also noting of hardware CPUs with poorly implemented but present extensions.
More details via the Google Open-Source Blog. The code to this library is hosted on GitHub under the Apache 2.0 license.
While there is /proc/cpuinfo for parsing CPU instruction set extensions and various other means of determining a processor's features, the new cpu_features library from Google is designed to be very portable, support different CPU architectures and operating systems, and can be used practically anywhere.
This library supports x86, ARM, ARM64 / AArch64, and MIPS processors currently and reports available CPU features. The library is written in C89 for making it portable as possible. This library also supports caching of results, checking compile time flags, and also noting of hardware CPUs with poorly implemented but present extensions.
More details via the Google Open-Source Blog. The code to this library is hosted on GitHub under the Apache 2.0 license.
15 Comments