Skip to content

Commit 2cb3b87

Browse files
committed
Revert CPU part of Commit b99ee45
1 parent 539eea2 commit 2cb3b87

File tree

9 files changed

+11554
-11725
lines changed

9 files changed

+11554
-11725
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,6 @@ add_library(ggml
424424
ggml/src/ggml-cpu/binary-ops.cpp
425425
ggml/src/ggml-cpu/unary-ops.h
426426
ggml/src/ggml-cpu/unary-ops.cpp
427-
ggml-cpu/simd-mappings.h
428-
ggml-cpu/vec.h
429-
ggml-cpu/vec.cpp
430-
ggml-cpu/ops.h
431-
ggml-cpu/ops.cpp
432427
ggml/src/ggml-backend-reg.cpp
433428
ggml/include/gguf.h
434429
ggml/src/gguf.cpp

Makefile

Lines changed: 23 additions & 35 deletions
Large diffs are not rendered by default.

ggml/src/ggml-cpu/ggml-cpu-impl.h

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
#include "ggml.h"
66
#include "ggml-impl.h"
7-
87
#include <stdlib.h> // load `stdlib.h` before other headers to work around MinGW bug: https://sourceforge.net/p/mingw-w64/bugs/192/
98
//#include <stddef.h>
109
#include <stdbool.h>
1110
#include <string.h> // memcpy
1211
#include <math.h> // fabsf
1312

13+
1414
#ifdef __cplusplus
1515
extern "C" {
1616
#endif
@@ -69,16 +69,33 @@ struct ggml_compute_params {
6969
#endif
7070

7171
#if defined(__ARM_FEATURE_SVE)
72+
#include <arm_sve.h>
7273
#include <sys/prctl.h>
7374
#endif
7475

76+
// 16-bit float
77+
// on Arm, we use __fp16
78+
// on x86, we use uint16_t
7579
#if defined(__ARM_NEON)
7680

77-
// ref: https://github.com/ggml-org/llama.cpp/pull/5404
81+
// if YCM cannot find <arm_neon.h>, make a symbolic link to it, for example:
82+
//
83+
// $ ln -sfn /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/arm_neon.h ./src/
84+
//
85+
#include <arm_neon.h>
86+
7887
#ifdef _MSC_VER
88+
89+
typedef uint16_t ggml_fp16_internal_t;
90+
7991
#define ggml_vld1q_u32(w,x,y,z) { ((w) + ((uint64_t)(x) << 32)), ((y) + ((uint64_t)(z) << 32)) }
92+
8093
#else
94+
95+
typedef __fp16 ggml_fp16_internal_t;
96+
8197
#define ggml_vld1q_u32(w,x,y,z) { (w), (x), (y), (z) }
98+
8299
#endif // _MSC_VER
83100

84101
#if !defined(__aarch64__)

0 commit comments

Comments
 (0)