]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : fix ppc64le build error and make cmake detect Power processors (#1284)
authorMarvin Gießing <redacted>
Tue, 2 May 2023 16:42:16 +0000 (18:42 +0200)
committerGitHub <redacted>
Tue, 2 May 2023 16:42:16 +0000 (19:42 +0300)
* Fix ppc64le build issue

* Added support to detect ppc64* processors

CMakeLists.txt
ggml.c

index f6a66daa34c7ea72f8ee9bf9751073ef0a848785..53d48a6c55e12d38010f11f41bce99c906dbaa97 100644 (file)
@@ -359,8 +359,11 @@ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86_64|i686|AMD64)$")
             add_compile_options(-mavx512vnni)
         endif()
     endif()
+elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64")
+    message(STATUS "PowerPC detected")
+    add_compile_options(-mcpu=native -mtune=native)
+    #TODO: Add  targets for Power8/Power9 (Altivec/VSX) and Power10(MMA) and query for big endian systems (ppc64/le/be)
 else()
-    # TODO: support PowerPC
     message(STATUS "Unknown architecture")
 endif()
 
diff --git a/ggml.c b/ggml.c
index 6a9695e2351809dc2b2c4a6d91514303a27caf8d..91b3053dd23fe8be057e1adedb0ce79487afb29f 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -826,6 +826,7 @@ static void quantize_row_q4_0(const float * restrict x, void * restrict vy, int
         float max = 0.0f;
         float min = 0.0f;
 
+        vector float asrcv [8];
         vector float srcv [8];
         vector float maxv[8];
         vector float minv[8];