ggml : support CUDA's half type for aarch64(#1455) (#2670)

* 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
This commit is contained in:
Kylin 2023-08-22 15:14:23 +08:00 committed by GitHub
parent 14b1d7e6f7
commit 1e3bc523d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
ggml.h
View File

@ -259,8 +259,9 @@
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;