diff options
author | Christian Baars <Staars> | 2021-04-29 16:52:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-04-29 16:58:51 +0300 |
commit | 87ba01dba90b0b2ffbad2b9e07552734959814db (patch) | |
tree | d9f45c352189725dab947b3cfaa0aa2b4c6b8afc /intern/cycles/util/util_system.cpp | |
parent | ffa70e769010a3b7e6b80be6f80b21dfb8713f13 (diff) |
Fix missing Cycles CPU name on macOS Arm
Differential Revision: https://developer.blender.org/D11061
Diffstat (limited to 'intern/cycles/util/util_system.cpp')
-rw-r--r-- | intern/cycles/util/util_system.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 6500a59e42c..8971867b736 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -145,7 +145,7 @@ int system_cpu_num_active_group_processors() return numaAPI_GetNumCurrentNodesProcessors(); } -#if !defined(_WIN32) || defined(FREE_WINDOWS) +#if !defined(__APPLE__) && (!defined(_WIN32) || defined(FREE_WINDOWS)) static void __cpuid(int data[4], int selector) { # if defined(__x86_64__) @@ -166,7 +166,13 @@ static void __cpuid(int data[4], int selector) string system_cpu_brand_string() { -#if !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__) +#if defined(__APPLE__) + char modelname[512] = ""; + size_t bufferlen = 512; + if (sysctlbyname("machdep.cpu.brand_string", &modelname, &bufferlen, NULL, 0) == 0) { + return modelname; + } +#elif !defined(WIN32) && !defined(__x86_64__) && !defined(__i386__) FILE *cpuinfo = fopen("/proc/cpuinfo", "r"); if (cpuinfo != nullptr) { char cpuinfo_buf[513] = ""; |