summaryrefslogtreecommitdiff
path: root/ggml-impl.h
diff options
context:
space:
mode:
authorMichael Podvitskiy <podvitskiymichael@gmail.com>2024-03-11 10:28:51 +0100
committerGitHub <noreply@github.com>2024-03-11 11:28:51 +0200
commit3202361c5b1ba15e695b31209567ef42c22c5c32 (patch)
treeab87c2d33904eeb87c4832375fa9261fbf11e871 /ggml-impl.h
parent332bdfd7980718abf664bfa5460f2288a3314984 (diff)
ggml, ci : Windows ARM runner and build fixes (#5979)
* windows arm ci * fix `error C2078: too many initializers` with ggml_vld1q_u32 macro for MSVC ARM64 * fix `warning C4146: unary minus operator applied to unsigned type, result still unsigned` * fix `error C2065: '__fp16': undeclared identifier`
Diffstat (limited to 'ggml-impl.h')
-rw-r--r--ggml-impl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/ggml-impl.h b/ggml-impl.h
index c5637e4d..e68b7287 100644
--- a/ggml-impl.h
+++ b/ggml-impl.h
@@ -53,26 +53,30 @@ extern "C" {
//
#include <arm_neon.h>
+typedef __fp16 ggml_fp16_internal_t;
+
#define GGML_COMPUTE_FP16_TO_FP32(x) ggml_compute_fp16_to_fp32(x)
#define GGML_COMPUTE_FP32_TO_FP16(x) ggml_compute_fp32_to_fp16(x)
#define GGML_FP16_TO_FP32(x) ggml_compute_fp16_to_fp32(x)
static inline float ggml_compute_fp16_to_fp32(ggml_fp16_t h) {
- __fp16 tmp;
+ ggml_fp16_internal_t tmp;
memcpy(&tmp, &h, sizeof(ggml_fp16_t));
return (float)tmp;
}
static inline ggml_fp16_t ggml_compute_fp32_to_fp16(float f) {
ggml_fp16_t res;
- __fp16 tmp = f;
+ ggml_fp16_internal_t tmp = f;
memcpy(&res, &tmp, sizeof(ggml_fp16_t));
return res;
}
#else
+typedef uint16_t ggml_fp16_internal_t;
+
#ifdef __wasm_simd128__
#include <wasm_simd128.h>
#else