Skip to content

Commit

Permalink
ggml : support CUDA's half type for aarch64(#1455) (#2670)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
KyL0N authored Aug 22, 2023
1 parent 14b1d7e commit 1e3bc52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1e3bc52

Please sign in to comment.