]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : support CUDA's half type for aarch64(#1455) (#2670)
authorKylin <redacted>
Tue, 22 Aug 2023 07:14:23 +0000 (15:14 +0800)
committerGitHub <redacted>
Tue, 22 Aug 2023 07:14:23 +0000 (10:14 +0300)
* ggml: support CUDA's half type for aarch64(#1455)
support CUDA's half type for aarch64 in ggml_fp16_t definition

* ggml: use __CUDACC__ to recognise nvcc compiler

ggml.h

diff --git a/ggml.h b/ggml.h
index 544ad2d1133744cbd5d5b7d07170c774d57eceaa..0ec7ec5bf95231d9de7d948c4bd2e1397bc1bc23 100644 (file)
--- a/ggml.h
+++ b/ggml.h
 extern "C" {
 #endif
 
-#ifdef __ARM_NEON
-    // we use the built-in 16-bit float type
+#if defined(__ARM_NEON) && defined(__CUDACC__)
+    typedef half ggml_fp16_t;
+#elif defined(__ARM_NEON)
     typedef __fp16 ggml_fp16_t;
 #else
     typedef uint16_t ggml_fp16_t;