mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-04 02:37:27 +02:00
ggml-cpu : conditionally add SpacemiT IME kernel sources (#27961)
When building with gcc < 15, CMakeLists.txt unconditionally adds ime2_kernels.cpp, which fails to compile. FindSMTIME.cmake only defines RISCV64_SPACEMIT_IME2 when the IME2 instructions are detected, and gcc 14 only has IME1, so ime2_kernels.cpp hits its #error. This PR fixes it by using IN_LIST to add each kernel source according to the spec that was actually detected.
This commit is contained in:
@@ -455,12 +455,16 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
|
|||||||
ggml-cpu/spacemit/repack.h
|
ggml-cpu/spacemit/repack.h
|
||||||
ggml-cpu/spacemit/ime_env.cpp
|
ggml-cpu/spacemit/ime_env.cpp
|
||||||
ggml-cpu/spacemit/ime_env.h
|
ggml-cpu/spacemit/ime_env.h
|
||||||
ggml-cpu/spacemit/ime1_kernels.cpp
|
|
||||||
ggml-cpu/spacemit/ime2_kernels.cpp
|
|
||||||
ggml-cpu/spacemit/ime_kernels.h
|
ggml-cpu/spacemit/ime_kernels.h
|
||||||
ggml-cpu/spacemit/rvv_kernels.cpp
|
ggml-cpu/spacemit/rvv_kernels.cpp
|
||||||
ggml-cpu/spacemit/rvv_kernels.h
|
ggml-cpu/spacemit/rvv_kernels.h
|
||||||
)
|
)
|
||||||
|
if ("RISCV64_SPACEMIT_IME1" IN_LIST RISCV64_SPACEMIT_IME_SPEC)
|
||||||
|
list(APPEND GGML_CPU_SOURCES ggml-cpu/spacemit/ime1_kernels.cpp)
|
||||||
|
endif()
|
||||||
|
if ("RISCV64_SPACEMIT_IME2" IN_LIST RISCV64_SPACEMIT_IME_SPEC)
|
||||||
|
list(APPEND GGML_CPU_SOURCES ggml-cpu/spacemit/ime2_kernels.cpp)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT GGML_CPU_ALL_VARIANTS)
|
if(NOT GGML_CPU_ALL_VARIANTS)
|
||||||
set(MARCH_STR "rv64gc")
|
set(MARCH_STR "rv64gc")
|
||||||
|
|||||||
Reference in New Issue
Block a user