fix(ggml): correct RISC-V ISA string canonical ordering for RVV in CMake (#20888)
Signed-off-by: ihb2032 <hebome@foxmail.com>
This commit is contained in:
@@ -460,6 +460,10 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
|
|||||||
endif()
|
endif()
|
||||||
if(NOT GGML_CPU_ALL_VARIANTS)
|
if(NOT GGML_CPU_ALL_VARIANTS)
|
||||||
set(MARCH_STR "rv64gc")
|
set(MARCH_STR "rv64gc")
|
||||||
|
if (GGML_RVV)
|
||||||
|
string(APPEND MARCH_STR "v")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (GGML_RV_ZFH)
|
if (GGML_RV_ZFH)
|
||||||
string(APPEND MARCH_STR "_zfh")
|
string(APPEND MARCH_STR "_zfh")
|
||||||
endif()
|
endif()
|
||||||
@@ -467,7 +471,6 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
|
|||||||
if (GGML_XTHEADVECTOR)
|
if (GGML_XTHEADVECTOR)
|
||||||
string(APPEND MARCH_STR "_xtheadvector")
|
string(APPEND MARCH_STR "_xtheadvector")
|
||||||
elseif (GGML_RVV)
|
elseif (GGML_RVV)
|
||||||
string(APPEND MARCH_STR "_v")
|
|
||||||
if (GGML_RV_ZVFH)
|
if (GGML_RV_ZVFH)
|
||||||
string(APPEND MARCH_STR "_zvfh")
|
string(APPEND MARCH_STR "_zvfh")
|
||||||
endif()
|
endif()
|
||||||
@@ -475,12 +478,14 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
|
|||||||
string(APPEND MARCH_STR "_zvfbfwma")
|
string(APPEND MARCH_STR "_zvfbfwma")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (GGML_RV_ZICBOP)
|
if (GGML_RV_ZICBOP)
|
||||||
string(APPEND MARCH_STR "_zicbop")
|
string(APPEND MARCH_STR "_zicbop")
|
||||||
endif()
|
endif()
|
||||||
if (GGML_RV_ZIHINTPAUSE)
|
if (GGML_RV_ZIHINTPAUSE)
|
||||||
string(APPEND MARCH_STR "_zihintpause")
|
string(APPEND MARCH_STR "_zihintpause")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND ARCH_FLAGS "-march=${MARCH_STR}" -mabi=lp64d)
|
list(APPEND ARCH_FLAGS "-march=${MARCH_STR}" -mabi=lp64d)
|
||||||
else()
|
else()
|
||||||
# Begin with the lowest baseline
|
# Begin with the lowest baseline
|
||||||
|
|||||||
Reference in New Issue
Block a user