]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : Allow usage of CLBlast alongside Accelerate.framework (#1336)
authorswittk <redacted>
Sun, 7 May 2023 03:03:23 +0000 (10:03 +0700)
committerGitHub <redacted>
Sun, 7 May 2023 03:03:23 +0000 (23:03 -0400)
Minor edit in ggml.c which originally would prevent OpenCL from loading completely if GGML_USE_ACCELERATE was defined.
Minor speedup in prompt eval time.

ggml.c

diff --git a/ggml.c b/ggml.c
index 4d49242a40f86ab32f4e94bd7d8c169f175029de..1b89bdd894489cdf8cb0311b310597c8f79dfed7 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -137,6 +137,9 @@ inline static void* ggml_aligned_malloc(size_t size) {
 
 #if defined(GGML_USE_ACCELERATE)
 #include <Accelerate/Accelerate.h>
+#if defined(GGML_USE_CLBLAST) // allow usage of CLBlast alongside Accelerate functions
+#include "ggml-opencl.h"
+#endif
 #elif defined(GGML_USE_OPENBLAS)
 #include <cblas.h>
 #elif defined(GGML_USE_CUBLAS)