]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : do not define GGML_USE_CUDA when building with GGML_BACKEND_DL (llama/11211)
authorRadoslav Gerganov <redacted>
Mon, 13 Jan 2025 11:31:41 +0000 (13:31 +0200)
committerGeorgi Gerganov <redacted>
Tue, 14 Jan 2025 08:38:01 +0000 (10:38 +0200)
Build fails when using HIP and GGML_BACKEND_DL:
```
/usr/bin/ld: ../ggml/src/libggml.so: undefined reference to `ggml_backend_cuda_reg'
collect2: error: ld returned 1 exit status
```
This patch fixes this.

ggml/src/ggml-hip/CMakeLists.txt

index b15fbd24d6b36e6d0b29024eae53daaac31163ba..d090ba9bd98fe8adf0a8d350cb787cb8e19ea569 100644 (file)
@@ -70,7 +70,9 @@ ggml_add_backend_library(ggml-hip
                         )
 
 # TODO: do not use CUDA definitions for HIP
-target_compile_definitions(ggml PUBLIC GGML_USE_CUDA)
+if (NOT GGML_BACKEND_DL)
+    target_compile_definitions(ggml PUBLIC GGML_USE_CUDA)
+endif()
 
 add_compile_definitions(GGML_USE_HIP)