]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : try to fix Android CI (#6780)
authorGeorgi Gerganov <redacted>
Sat, 20 Apr 2024 10:27:12 +0000 (13:27 +0300)
committerGitHub <redacted>
Sat, 20 Apr 2024 10:27:12 +0000 (13:27 +0300)
* common : disable get_math_cpu_count() until Android CI gets fixed

* common : another try

common/common.cpp

index cf69535e2d1f52911eb0c8b321f1626f2b7d9b4c..b6143e41c02cb356402849b0f5e1bc4327324eab 100644 (file)
@@ -108,7 +108,7 @@ int32_t get_num_physical_cores() {
     return n_threads > 0 ? (n_threads <= 4 ? n_threads : n_threads / 2) : 4;
 }
 
-#if defined(__x86_64__) && defined(__linux__)
+#if defined(__x86_64__) && defined(__linux__) && !defined(__ANDROID__)
 #include <pthread.h>
 
 static void cpuid(unsigned leaf, unsigned subleaf,
@@ -162,7 +162,7 @@ static int count_math_cpus(int cpu_count) {
  * Returns number of CPUs on system that are useful for math.
  */
 int get_math_cpu_count() {
-#if defined(__x86_64__) && defined(__linux__)
+#if defined(__x86_64__) && defined(__linux__) && !defined(__ANDROID__)
     int cpu_count = sysconf(_SC_NPROCESSORS_ONLN);
     if (cpu_count < 1) {
         return get_num_physical_cores();