Giter Site home page Giter Site logo

pytorch / cpuinfo Goto Github PK

View Code? Open in Web Editor NEW
936.0 239.0 293.0 4.99 MB

CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)

License: BSD 2-Clause "Simplified" License

Python 0.36% C 78.02% C++ 20.41% Makefile 0.03% CMake 0.66% Shell 0.37% Starlark 0.15%
cpu cpu-model instruction-set cpu-cache cpu-topology cpuid

cpuinfo's Introduction

CPU INFOrmation library

BSD (2 clause) License Linux/Mac build status Windows build status

cpuinfo is a library to detect essential for performance optimization information about host CPU.

Features

  • Cross-platform availability:
    • Linux, Windows, macOS, Android, and iOS operating systems
    • x86, x86-64, ARM, and ARM64 architectures
  • Modern C/C++ interface
    • Thread-safe
    • No memory allocation after initialization
    • No exceptions thrown
  • Detection of supported instruction sets, up to AVX512 (x86) and ARMv8.3 extensions
  • Detection of SoC and core information:
    • Processor (SoC) name
    • Vendor and microarchitecture for each CPU core
    • ID (MIDR on ARM, CPUID leaf 1 EAX value on x86) for each CPU core
  • Detection of cache information:
    • Cache type (instruction/data/unified), size and line size
    • Cache associativity
    • Cores and logical processors (hyper-threads) sharing the cache
  • Detection of topology information (relative between logical processors, cores, and processor packages)
  • Well-tested production-quality code:
    • 60+ mock tests based on data from real devices
    • Includes work-arounds for common bugs in hardware and OS kernels
    • Supports systems with heterogenous cores, such as big.LITTLE and Max.Med.Min
  • Permissive open-source license (Simplified BSD)

Examples

Log processor name:

cpuinfo_initialize();
printf("Running on %s CPU\n", cpuinfo_get_package(0)->name);

Detect if target is a 32-bit or 64-bit ARM system:

#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
    /* 32-bit ARM-specific code here */
#endif

Check if the host CPU supports ARM NEON

cpuinfo_initialize();
if (cpuinfo_has_arm_neon()) {
    neon_implementation(arguments);
}

Check if the host CPU supports x86 AVX

cpuinfo_initialize();
if (cpuinfo_has_x86_avx()) {
    avx_implementation(arguments);
}

Check if the thread runs on a Cortex-A53 core

cpuinfo_initialize();
switch (cpuinfo_get_current_core()->uarch) {
    case cpuinfo_uarch_cortex_a53:
        cortex_a53_implementation(arguments);
        break;
    default:
        generic_implementation(arguments);
        break;
}

Get the size of level 1 data cache on the fastest core in the processor (e.g. big core in big.LITTLE ARM systems):

cpuinfo_initialize();
const size_t l1_size = cpuinfo_get_processor(0)->cache.l1d->size;

Pin thread to cores sharing L2 cache with the current core (Linux or Android)

cpuinfo_initialize();
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
const struct cpuinfo_cache* current_l2 = cpuinfo_get_current_processor()->cache.l2;
for (uint32_t i = 0; i < current_l2->processor_count; i++) {
    CPU_SET(cpuinfo_get_processor(current_l2->processor_start + i)->linux_id, &cpu_set);
}
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpu_set);

Use via pkg-config

If you would like to provide your project's build environment with the necessary compiler and linker flags in a portable manner, the library by default when built enables CPUINFO_BUILD_PKG_CONFIG and will generate a pkg-config manifest (libcpuinfo.pc). Here are several examples of how to use it:

Command Line

If you used your distro's package manager to install the library, you can verify that it is available to your build environment like so:

$ pkg-config --cflags --libs libcpuinfo
-I/usr/include/x86_64-linux-gnu/ -L/lib/x86_64-linux-gnu/ -lcpuinfo

If you have installed the library from source into a non-standard prefix, pkg-config may need help finding it:

$ PKG_CONFIG_PATH="/home/me/projects/cpuinfo/prefix/lib/pkgconfig/:$PKG_CONFIG_PATH" pkg-config --cflags --libs libcpuinfo
-I/home/me/projects/cpuinfo/prefix/include -L/home/me/projects/cpuinfo/prefix/lib -lcpuinfo

GNU Autotools

To use with the GNU Autotools include the following snippet in your project's configure.ac:

# CPU INFOrmation library...
PKG_CHECK_MODULES(
    [libcpuinfo], [libcpuinfo], [],
    [AC_MSG_ERROR([libcpuinfo missing...])])
YOURPROJECT_CXXFLAGS="$YOURPROJECT_CXXFLAGS $libcpuinfo_CFLAGS"
YOURPROJECT_LIBS="$YOURPROJECT_LIBS $libcpuinfo_LIBS"

Meson

To use with Meson you just need to add dependency('libcpuinfo') as a dependency for your executable.

project(
    'MyCpuInfoProject',
    'cpp',
    meson_version: '>=0.55.0'
)

executable(
    'MyCpuInfoExecutable',
    sources: 'main.cpp',
    dependencies: dependency('libcpuinfo')
)

Bazel

This project can be built using Bazel.

You can also use this library as a dependency to your Bazel project. Add to the WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "org_pytorch_cpuinfo",
    branch = "master",
    remote = "https://github.com/Vertexwahn/cpuinfo.git",
)

And to your BUILD file:

cc_binary(
    name = "cpuinfo_test",
    srcs = [
        # ...
    ],
    deps = [
        "@org_pytorch_cpuinfo//:cpuinfo",
    ],
)

CMake

To use with CMake use the FindPkgConfig module. Here is an example:

cmake_minimum_required(VERSION 3.6)
project("MyCpuInfoProject")

find_package(PkgConfig)
pkg_check_modules(CpuInfo REQUIRED IMPORTED_TARGET libcpuinfo)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PkgConfig::CpuInfo)

Makefile

To use within a vanilla makefile, you can call pkg-config directly to supply compiler and linker flags using shell substitution.

CFLAGS=-g3 -Wall -Wextra -Werror ...
LDFLAGS=-lfoo ...
...
CFLAGS+= $(pkg-config --cflags libcpuinfo)
LDFLAGS+= $(pkg-config --libs libcpuinfo)

Exposed information

  • Processor (SoC) name
  • Microarchitecture
  • Usable instruction sets
  • CPU frequency
  • Cache
    • Size
    • Associativity
    • Line size
    • Number of partitions
    • Flags (unified, inclusive, complex hash function)
    • Topology (logical processors that share this cache level)
  • TLB
    • Number of entries
    • Associativity
    • Covered page types (instruction, data)
    • Covered page sizes
  • Topology information
    • Logical processors
    • Cores
    • Packages (sockets)

Supported environments:

  • Android
    • x86 ABI
    • x86_64 ABI
    • armeabi ABI
    • armeabiv7-a ABI
    • arm64-v8a ABI
    • mips ABI
    • mips64 ABI
  • Linux
    • x86
    • x86-64
    • 32-bit ARM (ARMv5T and later)
    • ARM64
    • PowerPC64
  • iOS
    • x86 (iPhone simulator)
    • x86-64 (iPhone simulator)
    • ARMv7
    • ARM64
  • macOS
    • x86
    • x86-64
    • ARM64 (Apple silicon)
  • Windows
    • x86
    • x86-64
    • arm64

Methods

  • Processor (SoC) name detection
    • Using CPUID leaves 0x80000002–0x80000004 on x86/x86-64
    • Using /proc/cpuinfo on ARM
    • Using ro.chipname, ro.board.platform, ro.product.board, ro.mediatek.platform, ro.arch properties (Android)
    • Using kernel log (dmesg) on ARM Linux
    • Using Windows registry on ARM64 Windows
  • Vendor and microarchitecture detection
    • Intel-designed x86/x86-64 cores (up to Sunny Cove, Goldmont Plus, and Knights Mill)
    • AMD-designed x86/x86-64 cores (up to Puma/Jaguar and Zen 2)
    • VIA-designed x86/x86-64 cores
    • Other x86 cores (DM&P, RDC, Transmeta, Cyrix, Rise)
    • ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/V1/N2/V2)
    • Qualcomm-designed ARM cores (Scorpion, Krait, and Kryo)
    • Nvidia-designed ARM cores (Denver and Carmel)
    • Samsung-designed ARM cores (Exynos)
    • Intel-designed ARM cores (XScale up to 3rd-gen)
    • Apple-designed ARM cores (up to Lightning and Thunder)
    • Cavium-designed ARM cores (ThunderX)
    • AppliedMicro-designed ARM cores (X-Gene)
  • Instruction set detection
    • Using CPUID (x86/x86-64)
    • Using /proc/cpuinfo on 32-bit ARM EABI (Linux)
    • Using microarchitecture heuristics on (32-bit ARM)
    • Using FPSID and WCID registers (32-bit ARM)
    • Using getauxval (Linux/ARM)
    • Using /proc/self/auxv (Android/ARM)
    • Using instruction probing on ARM (Linux)
    • Using CPUID registers on ARM64 (Linux)
    • Using IsProcessorFeaturePresent on ARM64 Windows
  • Cache detection
    • Using CPUID leaf 0x00000002 (x86/x86-64)
    • Using CPUID leaf 0x00000004 (non-AMD x86/x86-64)
    • Using CPUID leaves 0x80000005-0x80000006 (AMD x86/x86-64)
    • Using CPUID leaf 0x8000001D (AMD x86/x86-64)
    • Using /proc/cpuinfo (Linux/pre-ARMv7)
    • Using microarchitecture heuristics (ARM)
    • Using chipset name (ARM)
    • Using sysctlbyname (Mach)
    • Using sysfs typology directories (ARM/Linux)
    • Using sysfs cache directories (Linux)
    • Using GetLogicalProcessorInformationEx on ARM64 Windows
  • TLB detection
    • Using CPUID leaf 0x00000002 (x86/x86-64)
    • Using CPUID leaves 0x80000005-0x80000006 and 0x80000019 (AMD x86/x86-64)
    • Using microarchitecture heuristics (ARM)
  • Topology detection
    • Using CPUID leaf 0x00000001 on x86/x86-64 (legacy APIC ID)
    • Using CPUID leaf 0x0000000B on x86/x86-64 (Intel APIC ID)
    • Using CPUID leaf 0x8000001E on x86/x86-64 (AMD APIC ID)
    • Using /proc/cpuinfo (Linux)
    • Using host_info (Mach)
    • Using GetLogicalProcessorInformationEx (Windows)
    • Using sysfs (Linux)
    • Using chipset name (ARM/Linux)

cpuinfo's People

Contributors

ashkanaliabadi avatar blackhex avatar dipidoo avatar facebook-github-bot avatar gaborkertesz-linaro avatar huydhn avatar kamgurgul avatar keith avatar kiplingw avatar kolanich avatar kulinseth avatar ldong-arm avatar luncliff avatar malfet avatar maratyszcza avatar markdryan avatar mingfeima avatar naveenthangudu avatar norahsakal avatar oskidan avatar ozanmsft avatar paolotricerri avatar petrhosek avatar pnacht avatar prashanthswami avatar qukhan avatar snadampal avatar soumith avatar syoyo avatar vertexwahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpuinfo's Issues

ARM BF16

Please add ARM BF16 availability info.

Cpuinfo in sparc

I was able to compile pytorch on Debian 10, with Sparc processor. However, when it runs, it gives the error that it does not recognize the cpuinfo information and uses only one processor of the 32 existing ones. I would like to know if I can modify something to take at least one 16 core socket. On several occasions I was able to modify the code so that it takes the correct information. Thanks in advance.

Add a Minimal CPU support

Is it possible to define/specify a minimal CPU with the very minimal set of features and a very neutral architecture ?

This specification can to be used :

  1. Provide support for not-yet-defined CPUs, or not yet existing hardware. I see that there are at least two issues , one for SPARC (#53) and the other for PPC64 (#2 ).

  2. As a test CPU. Think of fooling pytorch to use this CPU instead of the hardware based one.

  3. For profiling new code. Think of using a very sophisticated XEON while disabling every sophisticated feature and comparing the floating point results and computation times.

  4. Some post-training operations, such as deployment, explanation and prediction do not need a very sophisticated CPU.

  5. Minimal CPU is ecologically friendly.

Thanks in advance

adding support for QNX

I am cross compiling libtorch for QNX and I came across cpuinfo which does not have an implementation for QNX. Is there a way to build libtorch and bypass cpuinfo? Otherwise I will create an implementation for cpuinfo for QNX

pytorch build fails: __NR_getcpu undeclared, a possible fix included

The current master branch of pytorch fails to build with the following error:

[86/3487] Building C object confu-deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o
FAILED: confu-deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o 
/home/pearu/miniconda3/envs/pytorch-cuda-dev/bin/x86_64-conda_cos6-linux-gnu-cc -DCPUINFO_LOG_LEVEL=2 -DTH_BLAS_MKL -D_GNU_SOURCE=1 -I../third_party/cpuinfo/src -I../third_party/cpuinfo/include -I../third_party/cpuinfo/deps/clog/include -isystem ../third_party/protobuf/src -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/pearu/miniconda3/envs/pytorch-cuda-dev/include -I/usr/local/cuda-10.1.243/include -L/home/pearu/miniconda3/envs/pytorch-cuda-dev/lib -O3 -DNDEBUG -fPIC   -std=c99 -MD -MT confu-deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o -MF confu-deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o.d -o confu-deps/cpuinfo/CMakeFiles/cpuinfo.dir/src/api.c.o   -c ../third_party/cpuinfo/src/api.c
In file included from ../third_party/cpuinfo/src/cpuinfo/internal-api.h:11:0,
                 from ../third_party/cpuinfo/src/api.c:5:
../third_party/cpuinfo/src/api.c: In function 'cpuinfo_get_current_processor':
../third_party/cpuinfo/src/api.c:316:31: error: '__NR_getcpu' undeclared (first use in this function); did you mean '__NR_getcwd'?
   if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
                               ^
../third_party/cpuinfo/src/cpuinfo/common.h:16:59: note: in definition of macro 'CPUINFO_UNLIKELY'
  #define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
                                                           ^~~~~~~~~
../third_party/cpuinfo/src/api.c:316:31: note: each undeclared identifier is reported only once for each function it appears in
   if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
                               ^
../third_party/cpuinfo/src/cpuinfo/common.h:16:59: note: in definition of macro 'CPUINFO_UNLIKELY'
  #define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
                                                           ^~~~~~~~~
../third_party/cpuinfo/src/api.c: In function 'cpuinfo_get_current_core':
../third_party/cpuinfo/src/api.c:334:31: error: '__NR_getcpu' undeclared (first use in this function); did you mean '__NR_getcwd'?
   if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
                               ^
../third_party/cpuinfo/src/cpuinfo/common.h:16:59: note: in definition of macro 'CPUINFO_UNLIKELY'
  #define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))

Applying

$ git diff
diff --git a/src/api.c b/src/api.c
index 0cc5d4e..5903edf 100644
--- a/src/api.c
+++ b/src/api.c
@@ -10,6 +10,7 @@
 
        #include <unistd.h>
        #include <sys/syscall.h>
+        #include <asm-generic/unistd.h>
 #endif

fixes the build issue.

Fix warning in clog.c about ignoring return value of ‘write’

Dozens of warnings in clog.c:

[  2%] Linking CXX shared library libonnxruntime_providers_shared.so
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c:112:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c: In function ‘clog_vlog_error’:
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c:188:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c: In function ‘clog_vlog_warning’:
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c:264:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c: In function ‘clog_vlog_info’:
/home/wtambellini/repos/onnxruntime/cmake/external/pytorch_cpuinfo/deps/clog/src/clog.c:340:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....

line 112

write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);

write() indeed returns a size_t :
https://linux.die.net/man/2/write
Would you mind if I add a check ? eg:

ssize_t rv =  write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
asert(rv != -1);

Feature Request: Support for iOS Simulator ARM64

I'm looking to build a fat Xcode xcframework via Bazel that pulls in cpuinfo as a dependency. When trying to build an iOS Simulator arm64 variation, I get the following error:

ERROR: <REDACTED>/cpuinfo/BUILD.bazel:100:11: configurable attribute "srcs" in @cpuinfo//:cpuinfo_impl doesn't match this configuration. Would a default condition help?

Conditions checked:
 @cpuinfo//:linux_x86_64
 @cpuinfo//:linux_arm
 @cpuinfo//:linux_armhf
 @cpuinfo//:linux_armv7a
 @cpuinfo//:linux_armeabi
 @cpuinfo//:linux_aarch64
 @cpuinfo//:linux_mips64
 @cpuinfo//:linux_riscv64
 @cpuinfo//:linux_s390x
 @cpuinfo//:macos_x86_64
 @cpuinfo//:macos_arm64
 @cpuinfo//:windows_x86_64
 @cpuinfo//:android_armv7
 @cpuinfo//:android_arm64
 @cpuinfo//:android_x86
 @cpuinfo//:android_x86_64
 @cpuinfo//:ios_x86_64
 @cpuinfo//:ios_x86
 @cpuinfo//:ios_armv7
 @cpuinfo//:ios_arm64
 @cpuinfo//:ios_arm64e
 @cpuinfo//:watchos_x86_64
 @cpuinfo//:watchos_x86
 @cpuinfo//:watchos_armv7k
 @cpuinfo//:watchos_arm64_32
 @cpuinfo//:tvos_x86_64
 @cpuinfo//:tvos_arm64
 @cpuinfo//:emscripten_wasm

undefined reference while building tests

[ 98%] Built target init-test
[100%] Linking CXX executable brand-string-test
/usr/bin/cmake -E cmake_link_script CMakeFiles/brand-string-test.dir/link.txt --verbose=1
/usr/bin/c++  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -rdynamic CMakeFiles/brand-string-test.dir/test/name/brand-string.cc.o  -o brand-string-test libcpuinfo.so.0 deps/googletest/googlemock/gtest/libgtest.a deps/googletest/googlemock/gtest/libgtest_main.a deps/googletest/googlemock/gtest/libgtest.a -pthread 
/usr/bin/ld: CMakeFiles/brand-string-test.dir/test/name/brand-string.cc.o: in function `normalize_brand_string[abi:cxx11](char const*)':
./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: undefined reference to `cpuinfo_x86_normalize_brand_string'
/usr/bin/ld: ./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: undefined reference to `cpuinfo_x86_normalize_brand_string'
/usr/bin/ld: ./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: undefined reference to `cpuinfo_x86_normalize_brand_string'
/usr/bin/ld: ./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: undefined reference to `cpuinfo_x86_normalize_brand_string'
/usr/bin/ld: ./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: undefined reference to `cpuinfo_x86_normalize_brand_string'
/usr/bin/ld: CMakeFiles/brand-string-test.dir/test/name/brand-string.cc.o:./obj-x86_64-linux-gnu/./test/name/brand-string.cc:14: more undefined references to `cpuinfo_x86_normalize_brand_string' follow
collect2: error: ld returned 1 exit status

https://launchpadlibrarian.net/401600199/buildlog_ubuntu-disco-amd64.cpuinfo_0.0~git20181211.d4fd8ca-1~ub1_BUILDING.txt.gz


the same error on i386: https://launchpadlibrarian.net/401600504/buildlog_ubuntu-disco-i386.cpuinfo_0.0~git20181211.d4fd8ca-1~ub1_BUILDING.txt.gz

Instructions for building for iOS?

Trying to configure/build for iOS using some of the various iOS CMake toolchain files out there, but just running into a bunch of problems or toolchains that require me to modify this project's CMakeLists.txt file. Would you mind sharing your toolchain or sharing instructions on how to build?

There is a bug. The order is reversed.

sdm660_64:/data/pengcuo # cat /proc/cpuinfo
Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 1
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 2
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 3
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x801
CPU revision : 4

processor : 4
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 2

processor : 5
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 2

processor : 6
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 2

processor : 7
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0xa
CPU part : 0x800
CPU revision : 2

sdm660_64:/data/pengcuo # ./cpu-info
SoC name: Qualcomm Snapdragon 660
Cores:
0: 1 processor (0), ARM Cortex-A73
1: 1 processor (1), ARM Cortex-A73
2: 1 processor (2), ARM Cortex-A73
3: 1 processor (3), ARM Cortex-A73
4: 1 processor (4), ARM Cortex-A53
5: 1 processor (5), ARM Cortex-A53
6: 1 processor (6), ARM Cortex-A53
7: 1 processor (7), ARM Cortex-A53
Logical processors:
0
1
2
3
4
5
6
7

src/arm/linux/aarch32-isa.c does't build for armv8

// success
$ clang -target armv7a-linux-androideabi src/arm/linux/aarch32-isa.c  -I src/ -I include -std=c99 -I deps/clog/include -c
// failure
$ clang -target armv7a-linux-androideabi src/arm/linux/aarch32-isa.c  -I src/ -I include -std=c99 -I deps/clog/include -c  -march=armv8-a
In file included from src/arm/linux/aarch32-isa.c:7:
src/arm/linux/cp.h:41:24: error: invalid operand for instruction
                __asm__ __volatile__("MRC p1, 0, %[wcid], c0, c0" : [wcid] "=r" (wcid));
                                     ^
<inline asm>:1:6: note: instantiated into assembly here
        MRC p1, 0, r0, c0, c0
            ^
1 error generated.

MRC is not available on armv8 and the function may need to use MRS instead. To account for this, libcpuinfo for Android is built entirely for armv7-a even for armv8-a targets.

cpuinfo_get_current_core() return NULL on mac (intel chip)

  • OS: macOSX 12.4
(base) ➜  cpuinfo git:(master) uname -a
Darwin ZZ-MBP.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64
  • cpuinfo commit:
    * 5e63739 2022-07-18 | Add bazel support for iOS arm64 simulator (#105) (HEAD -> master, origin/master, origin/HEAD) [Keith 
     Smiley]
    
  • Reproduce
#include <stdio.h>
#include "cpuinfo.h"

int main()
{
    cpuinfo_initialize();

    const cpuinfo_core* core = cpuinfo_get_current_core();
    printf("core is %p\n", core);

    cpuinfo_deinitialize();

    return 0;
}
  • Expected behaviour
    The print value of core should be not "0x0"
  • The actual output
core is 0x0

Arm build breaks when enabling -Werror

To reproduce (w/ bazel):

Update WORKSPACE.bazel with

android_sdk_repository(
    name = "androidsdk",
    path = PATH_TO_SDK,
)

android_ndk_repository(
    name = "androidndk",
    path = PATH_TO_NDK,
)

Update .bazelrc

build:android --crosstool_top=//external:android/crosstool
build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a

And build:

bazel build --copt=-Wall --config=android_arm64 cpuinfo

Error msg:

src/arm/linux/chipset.c:331:11: error: implicitly declaring library function 'tolower' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
                        ^
src/arm/linux/chipset.c:331:11: note: include the header <ctype.h> or explicitly provide a declaration for 'tolower'
1 error generated.
Target //:cpuinfo failed to build

error cpuinfo with pytorch on aws lambda

Hi I already opened an issue on the pytroch repo, but i think it is more appropriate to create one here instead, so some contexte:

I'm trying to use maskrcnn_benchmark in aws lambda env, I package pytroch on docker like so :

RUN git clone --recursive https://github.com/pytorch/pytorch.git --branch=v1.0.0

ENV NO_CUDA=1
ENV NO_TEST=1
ENV NO_NNPACK=1
ENV NO_QNNPACK=1
ENV NO_MKLDNN=1
ENV NO_DISTRIBUTED=1
ENV NO_CUDNN=1
ENV NO_FBGEMM=1
ENV NO_MIOPEN=1
ENV NO_CAFFE2_OPS=1
ENV BUILD_BINARY=0

RUN cd pytorch && python setup.py install

even through just installig it directly with pip install torch works the same way and gives the same error (originally I thought that it's maybe NNPACK or MKLDNN that tries to use multiple cpu's and generate the error)

the torch package is build successfully and I'm able to upload it on aws lambda, but I get the following errors when I try to run inference :
Error in cpuinfo: failed to parse the list of possible procesors in /sys/devices/system/cpu/possible
Error in cpuinfo: failed to parse the list of present procesors in /sys/devices/system/cpu/present

Thank you in advance, and if you have any additional questions I'll be happy to oblige !
Bendidi

test failure on armhf

[ RUN      ] CORE.known_vendor
/<<PKGBUILDDIR>>/test/init.cc:302: Failure
Expected: (cpuinfo_vendor_unknown) != (core->vendor), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:302: Failure
Expected: (cpuinfo_vendor_unknown) != (core->vendor), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:302: Failure
Expected: (cpuinfo_vendor_unknown) != (core->vendor), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:302: Failure
Expected: (cpuinfo_vendor_unknown) != (core->vendor), actual: 0 vs 0
[  FAILED  ] CORE.known_vendor (0 ms)
[ RUN      ] CORE.known_uarch
/<<PKGBUILDDIR>>/test/init.cc:313: Failure
Expected: (cpuinfo_uarch_unknown) != (core->uarch), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:313: Failure
Expected: (cpuinfo_uarch_unknown) != (core->uarch), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:313: Failure
Expected: (cpuinfo_uarch_unknown) != (core->uarch), actual: 0 vs 0
/<<PKGBUILDDIR>>/test/init.cc:313: Failure
Expected: (cpuinfo_uarch_unknown) != (core->uarch), actual: 0 vs 0
[  FAILED  ] CORE.known_uarch (1 ms)

https://launchpadlibrarian.net/401811786/buildlog_ubuntu-disco-armhf.cpuinfo_0.0~git20181216.bb16154-1~ub2_BUILDING.txt.gz

FYI other architectures are fine: https://launchpad.net/~lumin0/+archive/ubuntu/ppa/+sourcepub/9663137/+listing-archive-extra

AMD Zen 1 support broken

It thinks there's 1 L3 cache when there's 2, and 1 cluster when there should be 2. Tested on a Ryzen 5 1600 non-AF. If you need more info I'm more than happy to run any code and return the results.

error cpuinfo with pytorch on heroku

Hi

I am trying to create a python service, which uses pytorch model (fastai). It runs perfectly fine locally, but on heroku it gives below error (local is win 10, heroku has linux).

2019-01-11T12:39:53.041964+00:00 app[web.1]: Downloading: "https://download.pytorch.org/models/resnet34-333f7ec4.pth" to /app/models/resnet34-333f7ec4.pth
2019-01-11T12:39:55.637199+00:00 app[web.1]: 
2019-01-11T12:39:56.543386+00:00 app[web.1]: Error in cpuinfo: failed to parse the list of possible procesors in /sys/devices/system/cpu/possible
2019-01-11T12:39:56.543453+00:00 app[web.1]: Error in cpuinfo: failed to parse the list of present procesors in /sys/devices/system/cpu/present
2019-01-11T12:39:58.976469+00:00 app[web.1]: Traceback (most recent call last):
2019-01-11T12:39:58.976494+00:00 app[web.1]:   File "pytest.py", line 5, in <module>
2019-01-11T12:39:58.976582+00:00 app[web.1]:     model = FastaiImageClassifier()
2019-01-11T12:39:58.976587+00:00 app[web.1]:   File "/app/pymodel.py", line 22, in __init__
2019-01-11T12:39:58.976761+00:00 app[web.1]:     self.learner = self.setup_model(PATH_TO_MODELS_DIR, NAME_OF_PTH_FILE, YOUR_CLASSES_HERE)
2019-01-11T12:39:58.976766+00:00 app[web.1]:   File "/app/pymodel.py", line 37, in setup_model
2019-01-11T12:39:58.976933+00:00 app[web.1]:     learner = create_cnn(data, models.resnet34).load(learner_name_to_load)        
2019-01-11T12:39:58.976935+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/fastai/basic_train.py", line 213, in load
2019-01-11T12:39:58.977237+00:00 app[web.1]:     state = torch.load(self.path/self.model_dir/f'{name}.pth', map_location=device)
2019-01-11T12:39:58.977240+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/torch/serialization.py", line 367, in load
2019-01-11T12:39:58.977548+00:00 app[web.1]:     return _load(f, map_location, pickle_module)
2019-01-11T12:39:58.977550+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/torch/serialization.py", line 528, in _load
2019-01-11T12:39:58.977966+00:00 app[web.1]:     magic_number = pickle_module.load(f)
2019-01-11T12:39:58.977969+00:00 app[web.1]: _pickle.UnpicklingError: invalid load key, 'v'.

As per my understanding the pickle error was because pickle file download was not successful, and that was because of the error probably as

2019-01-11T12:39:56.543386+00:00 app[web.1]: Error in cpuinfo: failed to parse the list of possible procesors in /sys/devices/system/cpu/possible
2019-01-11T12:39:56.543453+00:00 app[web.1]: Error in cpuinfo: failed to parse the list of present procesors in /sys/devices/system/cpu/present

My app repo is here. Note, I have disabled all other components of the app and testing only python model handling part due to this error, so my procfile says to python pytest.py.

As stated in related issue for AWS 14 here is my heroku dump of /proc/cpuinfo. Kindly help. I tried to use both steady and also preview nightly build but same issue.

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 1
cpu cores	: 4
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 2
cpu cores	: 4
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 4
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 0
cpu cores	: 4
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 5
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 1
cpu cores	: 4
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 6
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 2
cpu cores	: 4
apicid		: 5
initial apicid	: 5
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2494.048
cache size	: 25600 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4988.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:


error: undefined symbol: cpuinfo_emscripten_init

When trying to use CPUInfo on Emscripten, I get the following linker error:

error: undefined symbol: cpuinfo_emscripten_init
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`

Indeed, no file in this repository provides an implementation for function cpuinfo_emscripten_init.

I've seen that XNNPACK guys contributed this function, but where is the implementation? I've seen that their bazel file mentions some src/emscripten/init.c file, but I cannot find it (even their patch file does not contain it).

CPUInfo reporting incorrect core count for Apple A10 (iPhone 7/7+)

According to https://en.wikipedia.org/wiki/Apple_A10 (and other sites documenting it), the Apple A10 processor has 4 cores, with two big and two LITTLE cores.

However CPUInfo is reporting only 2 cores (1 cluster with 2 cores, to be exact). There is also some log information being emitted:

Error in cpuinfo: sysctlbyname("hw.packages") failed: Operation not permitted
Error in cpuinfo: sysctlbyname("hw.cacheconfig") failed: Operation not permitted
Error in cpuinfo: sysctl("HW_L3CACHESIZE") failed: Invalid argument

This is with the latest revision of CPUInfo.

Compilation for freeRTOS

Hi all,

We are staring to look into using cpuinfo in a freeRTOS / ZedBoard setup.
Do you know if any attempts to port this code to freeRTOS before?
If not, do you have any tips / advise on how to start this porting?

Thanks,

Pablo.

IOS A12 neon dot error

I use cpuinfo in ios, and detect the arm neon dot instruction, and get the result:

ios-gtest: Begin to check cpu information, !!!!!!!!!!!!!!!!!!!!!!!!!!!
ios-gtest: cpuinfo_get_package(0)->name: Apple A12
ios-gtest: cpu processor count is : 6
ios-gtest: cpu support neon: 1
ios-gtest: cpu support fp16: 1
ios-gtest: cpu support dot: 0

It seems the A12 processor is not support neon dot instruction? but A12 arch is above than armv8.2, I don't know the reason, maybe there is a bug?

questions about documents

Hello
I am looking for a bug in cpuinfo using fuzzer
This is the plan to be reported to you.

However, there are questions
Do you know the cpuinfo API list or document?
I really want to make sure that the bugs I found are triggered outside.
BR

test failure on amd64 and i386

https://launchpadlibrarian.net/401832824/buildlog_ubuntu-disco-amd64.cpuinfo_0.0~git20181217.204ef6e-1~ub1_BUILDING.txt.gz
https://launchpadlibrarian.net/401832838/buildlog_ubuntu-disco-i386.cpuinfo_0.0~git20181217.204ef6e-1~ub1_BUILDING.txt.gz

I have changed the build script so that /proc/cpuinfo will be dumped before running tests.



processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 2
model name	: AMD Opteron 23xx (Gen 3 Class Opteron)
stepping	: 3
microcode	: 0x1000065
cpu MHz		: 2395.492
cache size	: 512 KB
physical id	: 3
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb lm rep_good nopl extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 arat
bugs		: tlb_mmatch fxsave_leak sysret_ss_attrs spectre_v1 spectre_v2
bogomips	: 4790.98
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management:

LD_LIBRARY_PATH=/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu dh_auto_test
	cd obj-x86_64-linux-gnu && make V=1 -j4 test ARGS\+=-j4
make[2]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
Running tests...
/usr/bin/ctest --force-new-ctest-process -j4
Test project /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu
    Start 1: init-test
    Start 2: get-current-test
    Start 3: brand-string-test
1/3 Test #1: init-test ........................***Failed    0.01 sec
Running main() from /usr/src/googletest/googletest/src/gtest_main.cc
[==========] Running 125 tests from 25 test cases.
[----------] Global test environment set-up.
[----------] 1 test from PROCESSORS_COUNT
[ RUN      ] PROCESSORS_COUNT.non_zero
Warning in cpuinfo: Line power management: in /proc/cpuinfo is ignored: value contains only spaces
Warning in cpuinfo: Line power management: in /proc/cpuinfo is ignored: value contains only spaces
Warning in cpuinfo: Line power management: in /proc/cpuinfo is ignored: value contains only spaces
Warning in cpuinfo: Line power management: in /proc/cpuinfo is ignored: value contains only spaces
[       OK ] PROCESSORS_COUNT.non_zero (0 ms)
[----------] 1 test from PROCESSORS_COUNT (0 ms total)

[----------] 1 test from PROCESSORS
[ RUN      ] PROCESSORS.non_null
[       OK ] PROCESSORS.non_null (0 ms)
[----------] 1 test from PROCESSORS (0 ms total)

[----------] 13 tests from PROCESSOR
[ RUN      ] PROCESSOR.non_null
[       OK ] PROCESSOR.non_null (0 ms)
[ RUN      ] PROCESSOR.valid_smt_id
[       OK ] PROCESSOR.valid_smt_id (0 ms)
[ RUN      ] PROCESSOR.valid_core
[       OK ] PROCESSOR.valid_core (0 ms)
[ RUN      ] PROCESSOR.consistent_core
[       OK ] PROCESSOR.consistent_core (0 ms)
[ RUN      ] PROCESSOR.valid_cluster
[       OK ] PROCESSOR.valid_cluster (0 ms)
[ RUN      ] PROCESSOR.consistent_cluster
[       OK ] PROCESSOR.consistent_cluster (0 ms)
[ RUN      ] PROCESSOR.valid_package
[       OK ] PROCESSOR.valid_package (0 ms)
[ RUN      ] PROCESSOR.consistent_package
[       OK ] PROCESSOR.consistent_package (0 ms)
[ RUN      ] PROCESSOR.consistent_l1i
[       OK ] PROCESSOR.consistent_l1i (0 ms)
[ RUN      ] PROCESSOR.consistent_l1d
[       OK ] PROCESSOR.consistent_l1d (0 ms)
[ RUN      ] PROCESSOR.consistent_l2
[       OK ] PROCESSOR.consistent_l2 (0 ms)
[ RUN      ] PROCESSOR.consistent_l3
[       OK ] PROCESSOR.consistent_l3 (0 ms)
[ RUN      ] PROCESSOR.consistent_l4
[       OK ] PROCESSOR.consistent_l4 (0 ms)
[----------] 13 tests from PROCESSOR (0 ms total)

[----------] 1 test from CORES_COUNT
[ RUN      ] CORES_COUNT.within_bounds
[       OK ] CORES_COUNT.within_bounds (0 ms)
[----------] 1 test from CORES_COUNT (0 ms total)

[----------] 1 test from CORES
[ RUN      ] CORES.non_null
[       OK ] CORES.non_null (0 ms)
[----------] 1 test from CORES (0 ms total)

[----------] 10 tests from CORE
[ RUN      ] CORE.non_null
[       OK ] CORE.non_null (0 ms)
[ RUN      ] CORE.non_zero_processors
[       OK ] CORE.non_zero_processors (0 ms)
[ RUN      ] CORE.consistent_processors
[       OK ] CORE.consistent_processors (0 ms)
[ RUN      ] CORE.valid_core_id
[       OK ] CORE.valid_core_id (0 ms)
[ RUN      ] CORE.valid_cluster
[       OK ] CORE.valid_cluster (0 ms)
[ RUN      ] CORE.consistent_cluster
[       OK ] CORE.consistent_cluster (0 ms)
[ RUN      ] CORE.valid_package
[       OK ] CORE.valid_package (0 ms)
[ RUN      ] CORE.consistent_package
[       OK ] CORE.consistent_package (0 ms)
[ RUN      ] CORE.known_vendor
[       OK ] CORE.known_vendor (0 ms)
[ RUN      ] CORE.known_uarch
[       OK ] CORE.known_uarch (0 ms)
[----------] 10 tests from CORE (0 ms total)

[----------] 1 test from CLUSTERS_COUNT
[ RUN      ] CLUSTERS_COUNT.within_bounds
[       OK ] CLUSTERS_COUNT.within_bounds (0 ms)
[----------] 1 test from CLUSTERS_COUNT (0 ms total)

[----------] 1 test from CLUSTERS
[ RUN      ] CLUSTERS.non_null
[       OK ] CLUSTERS.non_null (0 ms)
[----------] 1 test from CLUSTERS (0 ms total)

[----------] 14 tests from CLUSTER
[ RUN      ] CLUSTER.non_null
[       OK ] CLUSTER.non_null (0 ms)
[ RUN      ] CLUSTER.non_zero_processors
[       OK ] CLUSTER.non_zero_processors (0 ms)
[ RUN      ] CLUSTER.valid_processors
[       OK ] CLUSTER.valid_processors (0 ms)
[ RUN      ] CLUSTER.consistent_processors
[       OK ] CLUSTER.consistent_processors (0 ms)
[ RUN      ] CLUSTER.non_zero_cores
[       OK ] CLUSTER.non_zero_cores (0 ms)
[ RUN      ] CLUSTER.valid_cores
[       OK ] CLUSTER.valid_cores (0 ms)
[ RUN      ] CLUSTER.consistent_cores
[       OK ] CLUSTER.consistent_cores (0 ms)
[ RUN      ] CLUSTER.valid_cluster_id
[       OK ] CLUSTER.valid_cluster_id (0 ms)
[ RUN      ] CLUSTER.valid_package
[       OK ] CLUSTER.valid_package (0 ms)
[ RUN      ] CLUSTER.consistent_package
[       OK ] CLUSTER.consistent_package (0 ms)
[ RUN      ] CLUSTER.consistent_vendor
[       OK ] CLUSTER.consistent_vendor (0 ms)
[ RUN      ] CLUSTER.consistent_uarch
[       OK ] CLUSTER.consistent_uarch (0 ms)
[ RUN      ] CLUSTER.consistent_cpuid
[       OK ] CLUSTER.consistent_cpuid (0 ms)
[ RUN      ] CLUSTER.consistent_frequency
[       OK ] CLUSTER.consistent_frequency (0 ms)
[----------] 14 tests from CLUSTER (0 ms total)

[----------] 1 test from PACKAGES_COUNT
[ RUN      ] PACKAGES_COUNT.within_bounds
[       OK ] PACKAGES_COUNT.within_bounds (0 ms)
[----------] 1 test from PACKAGES_COUNT (0 ms total)

[----------] 1 test from PACKAGES
[ RUN      ] PACKAGES.non_null
[       OK ] PACKAGES.non_null (0 ms)
[----------] 1 test from PACKAGES (0 ms total)

[----------] 10 tests from PACKAGE
[ RUN      ] PACKAGE.non_null
[       OK ] PACKAGE.non_null (0 ms)
[ RUN      ] PACKAGE.non_zero_processors
[       OK ] PACKAGE.non_zero_processors (0 ms)
[ RUN      ] PACKAGE.valid_processors
[       OK ] PACKAGE.valid_processors (0 ms)
[ RUN      ] PACKAGE.consistent_processors
[       OK ] PACKAGE.consistent_processors (0 ms)
[ RUN      ] PACKAGE.non_zero_cores
[       OK ] PACKAGE.non_zero_cores (0 ms)
[ RUN      ] PACKAGE.valid_cores
[       OK ] PACKAGE.valid_cores (0 ms)
[ RUN      ] PACKAGE.consistent_cores
[       OK ] PACKAGE.consistent_cores (0 ms)
[ RUN      ] PACKAGE.non_zero_clusters
[       OK ] PACKAGE.non_zero_clusters (0 ms)
[ RUN      ] PACKAGE.valid_clusters
[       OK ] PACKAGE.valid_clusters (0 ms)
[ RUN      ] PACKAGE.consistent_cluster
[       OK ] PACKAGE.consistent_cluster (0 ms)
[----------] 10 tests from PACKAGE (0 ms total)

[----------] 1 test from L1I_CACHES_COUNT
[ RUN      ] L1I_CACHES_COUNT.within_bounds
[       OK ] L1I_CACHES_COUNT.within_bounds (0 ms)
[----------] 1 test from L1I_CACHES_COUNT (0 ms total)

[----------] 1 test from L1I_CACHES
[ RUN      ] L1I_CACHES.non_null
[       OK ] L1I_CACHES.non_null (0 ms)
[----------] 1 test from L1I_CACHES (0 ms total)

[----------] 13 tests from L1I_CACHE
[ RUN      ] L1I_CACHE.non_null
[       OK ] L1I_CACHE.non_null (0 ms)
[ RUN      ] L1I_CACHE.non_zero_size
[       OK ] L1I_CACHE.non_zero_size (0 ms)
[ RUN      ] L1I_CACHE.valid_size
/<<PKGBUILDDIR>>/test/init.cc:720: Failure
Expected equality of these values:
  cache->size
    Which is: 32768
  cache->associativity * cache->sets * cache->partitions * cache->line_size
    Which is: 0
/<<PKGBUILDDIR>>/test/init.cc:720: Failure
Expected equality of these values:
  cache->size
    Which is: 32768
  cache->associativity * cache->sets * cache->partitions * cache->line_size
    Which is: 0
/<<PKGBUILDDIR>>/test/init.cc:720: Failure
Expected equality of these values:
  cache->size
    Which is: 32768
  cache->associativity * cache->sets * cache->partitions * cache->line_size
    Which is: 0
/<<PKGBUILDDIR>>/test/init.cc:720: Failure
Expected equality of these values:
  cache->size
    Which is: 32768
  cache->associativity * cache->sets * cache->partitions * cache->line_size
    Which is: 0
[  FAILED  ] L1I_CACHE.valid_size (1 ms)

Frequency support

Any ETA on when you plan to expose frequency information, if ever?

cpuinfo causes crash on AWS Lambda with arm64 processor

This is a cross-post of the issue here: microsoft/onnxruntime#10038

ONNX Runtime uses cpuinfo to "detect hybrid cores and SDOT UDOT instruction support"; however, when used on the arm64 (Graviton2) processors, it fails with error message:

Error in cpuinfo: failed to parse the list of possible processors in /sys/devices/system/cpu/possible
Error in cpuinfo: failed to parse the list of present processors in /sys/devices/system/cpu/present

I'm happy to provide more detail, although I'm unsure how exactly ONNX Runtime uses cpuinfo.

x86 hybrid processor

According to Intel software developer manual, we can know whether the cpu is a hybrid processor, specifically, call cpuid with eax 7 and ecx 0, and read bit 15 of edx indicates

support cortex* in CMakeLists.txt

My cross compile environment sets CMAKE_SYSTEM_PROCESSOR as cortex5t2hf-vfp-...
This makes cmake complain with "not supported".

Could cortex* be added? Or alternatively could a mechanism be added to overwrite the value of CMAKE_SYSTEM_PROCESSOR?

Add support for pkg-config

If you would like to automatically have your project's build environment use the appropriate compiler and linker build flags, pkg-config can greatly simplify things. It is the portable international de facto standard for determining build flags. I've implemented support and will link my PR here.

[Question] does support iOS arm64e?

Hi there, when building this library for iPhoneOS/arm64e, I got following message:

CMake Warning at CMakeLists.txt:69 (MESSAGE):
  Target processor architecture "arm64e" is not supported in cpuinfo.
  cpuinfo will compile, but cpuinfo_initialize() will always fail.

I wanna know this library really do not support iPhoneOS/arm64e? Thanks.

Help required to add support for s390x

Hello,

We are looking forward to add s390x support to pytorch/cpuinfo.
There are some config files like api.h as for arm and x86. Example for arm at "https://github.com/pytorch/cpuinfo/blob/master/src/arm/linux/api.h#L54" which use some values already defined for CPUINFO and we are not really sure how they are generated.

Any help/guidance in this area on how the values are generated would be helpful.

Also could see there are multiple config files maintained for x86 and ARM:
x86: https://github.com/pytorch/cpuinfo/tree/master/src/x86/linux
arm: https://github.com/pytorch/cpuinfo/tree/master/src/arm/linux
Any insights on above would also be helpful.

Chip name "Unknown" for Galaxy S22

I compiled cpu-info for arm64 and ran the executable on a Galaxy S22. The name of the processor is unknown in the output, while the different core types have been successfully identified:

r0q:/data/local/tmp $ ./cpu-info
SoC name: Unknown
Microarchitectures:
        1x Cortex-X2
        3x Cortex-A710
        4x Cortex-A510
Cores:
        0: 1 processor (0), ARM Cortex-X2
        1: 1 processor (1), ARM Cortex-A710
        2: 1 processor (2), ARM Cortex-A710
        3: 1 processor (3), ARM Cortex-A710
        4: 1 processor (4), ARM Cortex-A510
        5: 1 processor (5), ARM Cortex-A510
        6: 1 processor (6), ARM Cortex-A510
        7: 1 processor (7), ARM Cortex-A510
Logical processors (System ID):
        0 (7)
        1 (4)
        2 (5)
        3 (6)
        4 (0)
        5 (1)
        6 (2)
        7 (3)

I've also built the library as well. Is there a way to get this processor's name through the cpu-info somehow?

undefined reference to `cpuinfo_loongarch_linux_init'

My pytorch version is 1.8
My computer is a loongarch, I want to adapt the cpuinfo library to my computer, so I added cpu_loongarch_linux_init according to the function cpuinfo_arm_linux_init, all the definitions are the same, why still report an error, the following is a hint
""/Usr/bin/ld: ../lib/libcpuinfo.a(init.c.o): in function cpuinfo_initialize': (.text+0x4): undefined reference to cpuinfo_loongarch_linux_init'
/usr/bin/ld: (.text+0x8): undefined reference to cpuinfo_loongarch_linux_init' /usr/bin/ld: (.text+0x8): undefined reference to cpuinfo_loongarch_linux_init'
/usr/bin/ld: ../lib/libtorch_cpu.so: hidden symbol `cpuinfo_loongarch_linux_init' isn't defined"

Issues when building with GCC 11

I would like to build cpuinfo but i got an error while compiling googletest:

ninja: Entering directory `build'
[1/8] Building CXX object deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
FAILED: deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o 
/usr/bin/c++  -I"/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/include" -I"/run/media/bensuperpc/cpuinfo/deps/googletest/googletest" -Wall -Wshadow -Werror -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -pthread -std=c++11 -MD -MT deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -MF deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o.d -o deps/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -c '/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-all.cc'
Dans le fichier inclus depuis /run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-all.cc:42:
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc: Dans la fonction « bool testing::internal::StackGrowsDown() »:
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1301:24: erreur: « dummy » pourrait être utilisé sans avoir été initialisé [-Werror=maybe-uninitialized]
 1301 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1290:13: note: par l'argument 1 de type « const void* » à « void testing::internal::StackLowerThanAddress(const void*, bool*) » déclaré ici
 1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/run/media/bensuperpc/cpuinfo/deps/googletest/googletest/src/gtest-death-test.cc:1299:7: note: « dummy » déclaré ici
 1299 |   int dummy;
      |       ^~~~~
cc1plus : tous les avertissements sont traités comme des erreurs
ninja: build stopped: subcommand failed.

I tested with Manjaro and dockcross, same issues.
Used commands:

mkdir -p build
cmake -S . -B build -G Ninja
ninja -C build

GCC info:

Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Cible : x86_64-pc-linux-gnu
Configuré avec: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Modèle de thread: posix
Algorithmes de compression LTO supportés: zlib zstd
gcc version 11.1.0 (GCC) 

I think it's related: google/googletest#3219

Unknown SoC name on Lenovo TB-J606F

Here is the content of cpuinfo:

Processor	: AArch64 Processor rev 4 (aarch64)
processor	: 0
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x801
CPU revision	: 4

processor	: 1
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x801
CPU revision	: 4

processor	: 2
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x801
CPU revision	: 4

processor	: 3
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x801
CPU revision	: 4

processor	: 4
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x800
CPU revision	: 2

processor	: 5
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x800
CPU revision	: 2

processor	: 6
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x800
CPU revision	: 2

processor	: 7
BogoMIPS	: 38.40
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer	: 0x51
CPU architecture: 8
CPU variant	: 0xa
CPU part	: 0x800
CPU revision	: 2

Hardware	: Qualcomm Technologies, Inc BENGALP

clog in both cpuinfo and nnpack...

If I install one package, I''ll fail the other with the following ERROR message:

Unpacking cpuinfo (20180706-6) ...
dpkg: error processing archive ....../cpuinfo/build/cpuinfo_20180706-6_amd64.deb (--install):
 trying to overwrite '/usr/local/include/clog.h', which is also in package nnpack 20180706-6
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:

Any suggestions?

Detect/report big.LITTLE w/o GTS

Early big.LITTLE implementations (e.g. Exynos 5410, Apple A10) did not support running both clusters at the same time - please add the ability to distinguish between these cases (as it makes a difference for example for effective CPU cache sizes detection if a task can be scheduled to run on both the smaller and larger CPUs)...

Official releases?

It might be good for downstream packagers to have official releases of this.

Would you consider having some?

I believe i have some cmake code stubs that I could share that make creating versions based on tags if that helps.

Request a release

Hi, is it possible to publish release versions regularly? Rather than a git hash 'abcdxxxxxxxxxxxx', a relase version like '0.1' will benefit for tests and integration, making it easier to reproduce results against a specific version.

cpuinfo: PPC64 support

Hello @Maratyszcza and team,

I would like to have PPC64 support on cpuinfo project. I was able to fork it[1], and together with some friends (Rogério and Alfredo), got it partially ported to PPC64. There are some missing things, but, at this moment, all the tests are passing.

That said, I have some questions regarding the PPC64 port:

  1. Are you interested in adding PPC64 support into cpuinfo project?
  2. If you kindly accept our contribution, what is the best method to contribute it?
  3. Do you want to have the PPC64 support fully implemented before us trying to contribute, or, can we start the review process with what the current code, while we get the port complete.

Thank you,
Breno

[1] https://github.com/leitao/cpuinfo/

Windows ARM64 support

Windows ARM64 isn't currently supported.

On Windows ARM64, you can use GetLogicalProcessorInformationExW like x86. To detect hardware features, you can use IsProcessorFeaturePresent. (Check WinNT.h in the latest SDK, because some of them aren't documented on MSDN yet.) Also, the __try trick could also work.

The vendor and processor model are the VendorIdentifier and Identifier values of HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0. (On x86, these registry fields are copies of the vendor and brand string from cpuid. But on ARM, there's no user-mode way to query this.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.