mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-26 03:14:35 +00:00
ggml-ci
This commit is contained in:
parent
92a96865cd
commit
ee154457dd
@ -1125,17 +1125,17 @@ ggml_type_traits_t ggml_internal_get_type_traits(enum ggml_type type) {
|
|||||||
{ \
|
{ \
|
||||||
int offset = GGML_F32_ARR >> 1; \
|
int offset = GGML_F32_ARR >> 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f32(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f32((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
offset >>= 1; \
|
offset >>= 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f32(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f32((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
offset >>= 1; \
|
offset >>= 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f32(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f32((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
res = GGML_F32x4_REDUCE_ONE(x[0]); \
|
(res) = GGML_F32x4_REDUCE_ONE((x)[0]); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GGML_F32_VEC GGML_F32x4
|
#define GGML_F32_VEC GGML_F32x4
|
||||||
@ -1166,26 +1166,26 @@ ggml_type_traits_t ggml_internal_get_type_traits(enum ggml_type type) {
|
|||||||
do { \
|
do { \
|
||||||
int offset = GGML_F16_ARR >> 1; \
|
int offset = GGML_F16_ARR >> 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f16(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f16((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
offset >>= 1; \
|
offset >>= 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f16(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f16((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
offset >>= 1; \
|
offset >>= 1; \
|
||||||
for (int i = 0; i < offset; ++i) { \
|
for (int i = 0; i < offset; ++i) { \
|
||||||
x[i] = vaddq_f16(x[i], x[offset+i]); \
|
(x)[i] = vaddq_f16((x)[i], (x)[offset+i]); \
|
||||||
} \
|
} \
|
||||||
const float32x4_t t0 = vcvt_f32_f16(vget_low_f16 (x[0])); \
|
const float32x4_t t0 = vcvt_f32_f16(vget_low_f16 ((x)[0])); \
|
||||||
const float32x4_t t1 = vcvt_f32_f16(vget_high_f16(x[0])); \
|
const float32x4_t t1 = vcvt_f32_f16(vget_high_f16((x)[0])); \
|
||||||
res = (ggml_float) vaddvq_f32(vaddq_f32(t0, t1)); \
|
(res) = (ggml_float) vaddvq_f32(vaddq_f32(t0, t1)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define GGML_F16_VEC GGML_F16x8
|
#define GGML_F16_VEC GGML_F16x8
|
||||||
#define GGML_F16_VEC_ZERO GGML_F16x8_ZERO
|
#define GGML_F16_VEC_ZERO GGML_F16x8_ZERO
|
||||||
#define GGML_F16_VEC_SET1 GGML_F16x8_SET1
|
#define GGML_F16_VEC_SET1 GGML_F16x8_SET1
|
||||||
#define GGML_F16_VEC_LOAD(p, i) GGML_F16x8_LOAD(p)
|
#define GGML_F16_VEC_LOAD(p, i) GGML_F16x8_LOAD(p)
|
||||||
#define GGML_F16_VEC_STORE(p, r, i) GGML_F16x8_STORE((ggml_fp16_internal_t *)(p), r[i])
|
#define GGML_F16_VEC_STORE(p, r, i) GGML_F16x8_STORE((ggml_fp16_internal_t *)(p), (r)[i])
|
||||||
#define GGML_F16_VEC_FMA GGML_F16x8_FMA
|
#define GGML_F16_VEC_FMA GGML_F16x8_FMA
|
||||||
#define GGML_F16_VEC_ADD GGML_F16x8_ADD
|
#define GGML_F16_VEC_ADD GGML_F16x8_ADD
|
||||||
#define GGML_F16_VEC_MUL GGML_F16x8_MUL
|
#define GGML_F16_VEC_MUL GGML_F16x8_MUL
|
||||||
|
Loading…
Reference in New Issue
Block a user