From 60e0c678746c44fb94da5924bac240926d6d0f6e Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sun, 21 May 2023 21:13:17 +0800 Subject: [PATCH] fix compile errors on cuda --- CMakeLists.txt | 2 +- otherarch/ggml_v2.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa50a490a..44bbf1158 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,6 +322,6 @@ target_compile_features(${TARGET} PUBLIC cxx_std_11) # don't bump set_target_properties(${TARGET} PROPERTIES PREFIX "") set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "koboldcpp") set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON) -target_link_libraries(${TARGET} PUBLIC ggml ggml_v1 common2 gpttype_adapter ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(${TARGET} PUBLIC ggml ggml_v1 ggml_v2 common2 gpttype_adapter ${CMAKE_THREAD_LIBS_INIT}) target_compile_features(${TARGET} PRIVATE cxx_std_11) diff --git a/otherarch/ggml_v2.c b/otherarch/ggml_v2.c index 7599ddbc9..7c0439af9 100644 --- a/otherarch/ggml_v2.c +++ b/otherarch/ggml_v2.c @@ -3893,7 +3893,7 @@ struct ggml_v2_context * ggml_v2_init(struct ggml_v2_init_params params) { } #if defined(GGML_USE_CUBLAS) - ggml_v2_init_cublas(); + ggml_init_cublas(); #elif defined(GGML_USE_CLBLAST) if(quants_unshuffled) { @@ -9447,9 +9447,9 @@ static void ggml_v2_compute_forward_mul_mat_f32( // compute by src0 rows #if defined(GGML_USE_CUBLAS) - if (ggml_v2_cuda_can_mul_mat(src0, src1, dst)) { + if (ggml_cuda_can_mul_mat(src0, src1, dst)) { if (params->ith == 0 && params->type == GGML_V2_TASK_COMPUTE) { - ggml_v2_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); + ggml_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); } return; } @@ -9641,9 +9641,9 @@ static void ggml_v2_compute_forward_mul_mat_f16_f32( // compute by src0 rows #if defined(GGML_USE_CUBLAS) - if (ggml_v2_cuda_can_mul_mat(src0, src1, dst)) { + if (ggml_cuda_can_mul_mat(src0, src1, dst)) { if (params->ith == 0 && params->type == GGML_V2_TASK_COMPUTE) { - ggml_v2_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); + ggml_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); } return; } @@ -9880,9 +9880,9 @@ static void ggml_v2_compute_forward_mul_mat_q_f32( // compute by src0 rows #if defined(GGML_USE_CUBLAS) - if (ggml_v2_cuda_can_mul_mat(src0, src1, dst)) { + if (ggml_cuda_can_mul_mat(src0, src1, dst)) { if (params->ith == 0 && params->type == GGML_V2_TASK_COMPUTE) { - ggml_v2_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); + ggml_cuda_mul_mat(src0, src1, dst, params->wdata, params->wsize); } return; } @@ -14060,10 +14060,10 @@ void ggml_v2_graph_compute(struct ggml_v2_context * ctx, struct ggml_v2_cgraph * size_t cur = 0; #if defined(GGML_USE_CUBLAS) - if (ggml_v2_cuda_can_mul_mat(node->src0, node->src1, node)) { + if (ggml_cuda_can_mul_mat(node->src0, node->src1, node)) { node->n_tasks = 1; // TODO: this actually is doing nothing // the threads are still spinning - cur = ggml_v2_cuda_mul_mat_get_wsize(node->src0, node->src1, node); + cur = ggml_cuda_mul_mat_get_wsize(node->src0, node->src1, node); } else #elif defined(GGML_USE_CLBLAST)