Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ggml/src/ggml-spacemit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ endif()
ggml_add_backend_library(${TARGET_NAME}
ggml-spacemit.cpp
ime.cpp
ime1_kernels.cpp
ime2_kernels.cpp
rvv_kernels.cpp
scalar_kernels.cpp
repack.cpp
Expand All @@ -58,6 +56,13 @@ ggml_add_backend_library(${TARGET_NAME}
spine_mem_pool.cpp
../../include/ggml-spacemit.h)

if("RISCV64_SPACEMIT_IME1" IN_LIST RISCV64_SPACEMIT_IME_SPEC)
target_sources(${TARGET_NAME} PRIVATE ime1_kernels.cpp)
endif()
if("RISCV64_SPACEMIT_IME2" IN_LIST RISCV64_SPACEMIT_IME_SPEC)
target_sources(${TARGET_NAME} PRIVATE ime2_kernels.cpp)
endif()

set_target_properties(${TARGET_NAME} PROPERTIES
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden)
Expand Down
4 changes: 4 additions & 0 deletions ggml/src/ggml-spacemit/spe_kernel_dispatch.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#if defined(RISCV64_SPACEMIT_IME2)
#include "ggml.h"
#include "ime_kernels.h"
#include "spe_kernels_core.h"

#include <typeindex>
#include <vector>
#endif

#if defined(__OHOS__) && defined(__riscv) && defined(__riscv_zfh)
// Supply the missing _Float16 RTTI using the Itanium C++ ABI layout.
Expand All @@ -19,6 +21,7 @@ void * _ZTIDF16_[] = {
};
#endif

#if defined(RISCV64_SPACEMIT_IME2)
namespace mlir::speir::spekernel {

// FP32 [M,K] -> FP16 [dst_mc,dst_kc,16,8]; offsets and strides are bytes.
Expand Down Expand Up @@ -358,3 +361,4 @@ void gemm_kernel_f16f16f16_m16_vfwmadot(size_t gemm_k,
}

} // namespace spacemit_kernels::ime2
#endif // RISCV64_SPACEMIT_IME2
Loading