Skip to content

Commit 65a4236

Browse files
committed
split ggml-cann to multi files
1 parent 9e5a764 commit 65a4236

File tree

10 files changed

+894
-838
lines changed

10 files changed

+894
-838
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,8 @@ if (LLAMA_CANN)
846846
message(STATUS "CANN: CANN_INCLUDE_DIRS = ${CANN_INCLUDE_DIRS}")
847847
message(STATUS "CANN: CANN_LIBRARIES = ${CANN_LIBRARIES}")
848848
set(GGML_HEADERS_CANN ggml-cann.h)
849-
set(GGML_SOURCES_CANN ggml-cann.cpp)
849+
file(GLOB GGML_SOURCES_CUDA "ggml-cann/*.cpp")
850+
list(APPEND GGML_SOURCES_CANN "ggml-cann.cpp")
850851
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${CANN_LIBRARIES})
851852
set(LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ${CANN_INCLUDE_DIRS})
852853
add_compile_definitions(GGML_USE_CANN)

examples/llama-bench/llama-bench.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ static std::string get_gpu_info() {
140140
}
141141
#endif
142142
#ifdef GGML_USE_CANN
143-
int count = ggml_cann_get_device_count();
144-
for (int i = 0; i < count; i++) {
143+
uint32_t count = ggml_backend_cann_get_device_count();
144+
for (uint32_t i = 0; i < count; i++) {
145145
char buf[128];
146-
ggml_cann_get_device_description(i, buf, sizeof(buf));
146+
ggml_backend_cann_get_device_description(i, buf, sizeof(buf));
147147
id += buf;
148148
if (i < count - 1) {
149149
id += "/";

0 commit comments

Comments
 (0)