Skip to content

Commit

Permalink
split ggml-cann to multi files
Browse files Browse the repository at this point in the history
  • Loading branch information
hipudding committed Mar 28, 2024
1 parent 9e5a764 commit 65a4236
Show file tree
Hide file tree
Showing 10 changed files with 894 additions and 838 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,8 @@ if (LLAMA_CANN)
message(STATUS "CANN: CANN_INCLUDE_DIRS = ${CANN_INCLUDE_DIRS}")
message(STATUS "CANN: CANN_LIBRARIES = ${CANN_LIBRARIES}")
set(GGML_HEADERS_CANN ggml-cann.h)
set(GGML_SOURCES_CANN ggml-cann.cpp)
file(GLOB GGML_SOURCES_CUDA "ggml-cann/*.cpp")
list(APPEND GGML_SOURCES_CANN "ggml-cann.cpp")
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${CANN_LIBRARIES})
set(LLAMA_EXTRA_INCLUDES ${LLAMA_EXTRA_INCLUDES} ${CANN_INCLUDE_DIRS})
add_compile_definitions(GGML_USE_CANN)
Expand Down
6 changes: 3 additions & 3 deletions examples/llama-bench/llama-bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ static std::string get_gpu_info() {
}
#endif
#ifdef GGML_USE_CANN
int count = ggml_cann_get_device_count();
for (int i = 0; i < count; i++) {
uint32_t count = ggml_backend_cann_get_device_count();
for (uint32_t i = 0; i < count; i++) {
char buf[128];
ggml_cann_get_device_description(i, buf, sizeof(buf));
ggml_backend_cann_get_device_description(i, buf, sizeof(buf));
id += buf;
if (i < count - 1) {
id += "/";
Expand Down
Loading

0 comments on commit 65a4236

Please sign in to comment.