]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
fix(ggml): correct RISC-V ISA string canonical ordering for RVV in CMake (#20888)
authorihb2032 <redacted>
Thu, 26 Mar 2026 11:08:41 +0000 (19:08 +0800)
committerGitHub <redacted>
Thu, 26 Mar 2026 11:08:41 +0000 (13:08 +0200)
Signed-off-by: ihb2032 <redacted>
ggml/src/ggml-cpu/CMakeLists.txt

index 1a1bbc9f2beb8eccbfa957b13dcfd680d4c52e9f..beebc4760d2d2b116a76ada46ec70e65c992e015 100644 (file)
@@ -460,6 +460,10 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
         endif()
         if(NOT GGML_CPU_ALL_VARIANTS)
             set(MARCH_STR "rv64gc")
+            if (GGML_RVV)
+                string(APPEND MARCH_STR "v")
+            endif()
+
             if (GGML_RV_ZFH)
                 string(APPEND MARCH_STR "_zfh")
             endif()
@@ -467,7 +471,6 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
             if (GGML_XTHEADVECTOR)
                 string(APPEND MARCH_STR "_xtheadvector")
             elseif (GGML_RVV)
-                string(APPEND MARCH_STR "_v")
                 if (GGML_RV_ZVFH)
                     string(APPEND MARCH_STR "_zvfh")
                 endif()
@@ -475,12 +478,14 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
                     string(APPEND MARCH_STR "_zvfbfwma")
                 endif()
             endif()
+
             if (GGML_RV_ZICBOP)
                 string(APPEND MARCH_STR "_zicbop")
             endif()
             if (GGML_RV_ZIHINTPAUSE)
                 string(APPEND MARCH_STR "_zihintpause")
             endif()
+
             list(APPEND ARCH_FLAGS "-march=${MARCH_STR}" -mabi=lp64d)
         else()
             # Begin with the lowest baseline