Skip to content

Commit dc8d14c

Browse files
authored
fix(ggml): correct RISC-V ISA string canonical ordering for RVV in CMake (ggml-org#20888)
Signed-off-by: ihb2032 <hebome@foxmail.com>
1 parent 93dfbc1 commit dc8d14c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ggml/src/ggml-cpu/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,27 +460,32 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
460460
endif()
461461
if(NOT GGML_CPU_ALL_VARIANTS)
462462
set(MARCH_STR "rv64gc")
463+
if (GGML_RVV)
464+
string(APPEND MARCH_STR "v")
465+
endif()
466+
463467
if (GGML_RV_ZFH)
464468
string(APPEND MARCH_STR "_zfh")
465469
endif()
466470

467471
if (GGML_XTHEADVECTOR)
468472
string(APPEND MARCH_STR "_xtheadvector")
469473
elseif (GGML_RVV)
470-
string(APPEND MARCH_STR "_v")
471474
if (GGML_RV_ZVFH)
472475
string(APPEND MARCH_STR "_zvfh")
473476
endif()
474477
if (GGML_RV_ZVFBFWMA)
475478
string(APPEND MARCH_STR "_zvfbfwma")
476479
endif()
477480
endif()
481+
478482
if (GGML_RV_ZICBOP)
479483
string(APPEND MARCH_STR "_zicbop")
480484
endif()
481485
if (GGML_RV_ZIHINTPAUSE)
482486
string(APPEND MARCH_STR "_zihintpause")
483487
endif()
488+
484489
list(APPEND ARCH_FLAGS "-march=${MARCH_STR}" -mabi=lp64d)
485490
else()
486491
# Begin with the lowest baseline

0 commit comments

Comments
 (0)