Spaces:
Running
Running
duthils
commited on
make : disable avx in case f16c is not available (#706)
Browse filesWhy:
* ggml.c does not support AVX without F16C
Makefile
CHANGED
|
@@ -77,10 +77,6 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
|
| 77 |
CFLAGS += -mavx2
|
| 78 |
endif
|
| 79 |
else ifeq ($(UNAME_S),Linux)
|
| 80 |
-
AVX1_M := $(shell grep "avx " /proc/cpuinfo)
|
| 81 |
-
ifneq (,$(findstring avx,$(AVX1_M)))
|
| 82 |
-
CFLAGS += -mavx
|
| 83 |
-
endif
|
| 84 |
AVX2_M := $(shell grep "avx2 " /proc/cpuinfo)
|
| 85 |
ifneq (,$(findstring avx2,$(AVX2_M)))
|
| 86 |
CFLAGS += -mavx2
|
|
@@ -92,16 +88,17 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
|
| 92 |
F16C_M := $(shell grep "f16c " /proc/cpuinfo)
|
| 93 |
ifneq (,$(findstring f16c,$(F16C_M)))
|
| 94 |
CFLAGS += -mf16c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
endif
|
| 96 |
SSE3_M := $(shell grep "sse3 " /proc/cpuinfo)
|
| 97 |
ifneq (,$(findstring sse3,$(SSE3_M)))
|
| 98 |
CFLAGS += -msse3
|
| 99 |
endif
|
| 100 |
else ifeq ($(UNAME_S),Haiku)
|
| 101 |
-
AVX1_M := $(shell sysinfo -cpu | grep "AVX ")
|
| 102 |
-
ifneq (,$(findstring avx,$(AVX1_M)))
|
| 103 |
-
CFLAGS += -mavx
|
| 104 |
-
endif
|
| 105 |
AVX2_M := $(shell sysinfo -cpu | grep "AVX2 ")
|
| 106 |
ifneq (,$(findstring avx2,$(AVX2_M)))
|
| 107 |
CFLAGS += -mavx2
|
|
@@ -113,6 +110,11 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
|
|
| 113 |
F16C_M := $(shell sysinfo -cpu | grep "F16C ")
|
| 114 |
ifneq (,$(findstring f16c,$(F16C_M)))
|
| 115 |
CFLAGS += -mf16c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
endif
|
| 117 |
else
|
| 118 |
CFLAGS += -mfma -mf16c -mavx -mavx2
|
|
|
|
| 77 |
CFLAGS += -mavx2
|
| 78 |
endif
|
| 79 |
else ifeq ($(UNAME_S),Linux)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
AVX2_M := $(shell grep "avx2 " /proc/cpuinfo)
|
| 81 |
ifneq (,$(findstring avx2,$(AVX2_M)))
|
| 82 |
CFLAGS += -mavx2
|
|
|
|
| 88 |
F16C_M := $(shell grep "f16c " /proc/cpuinfo)
|
| 89 |
ifneq (,$(findstring f16c,$(F16C_M)))
|
| 90 |
CFLAGS += -mf16c
|
| 91 |
+
|
| 92 |
+
AVX1_M := $(shell grep "avx " /proc/cpuinfo)
|
| 93 |
+
ifneq (,$(findstring avx,$(AVX1_M)))
|
| 94 |
+
CFLAGS += -mavx
|
| 95 |
+
endif
|
| 96 |
endif
|
| 97 |
SSE3_M := $(shell grep "sse3 " /proc/cpuinfo)
|
| 98 |
ifneq (,$(findstring sse3,$(SSE3_M)))
|
| 99 |
CFLAGS += -msse3
|
| 100 |
endif
|
| 101 |
else ifeq ($(UNAME_S),Haiku)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
AVX2_M := $(shell sysinfo -cpu | grep "AVX2 ")
|
| 103 |
ifneq (,$(findstring avx2,$(AVX2_M)))
|
| 104 |
CFLAGS += -mavx2
|
|
|
|
| 110 |
F16C_M := $(shell sysinfo -cpu | grep "F16C ")
|
| 111 |
ifneq (,$(findstring f16c,$(F16C_M)))
|
| 112 |
CFLAGS += -mf16c
|
| 113 |
+
|
| 114 |
+
AVX1_M := $(shell sysinfo -cpu | grep "AVX ")
|
| 115 |
+
ifneq (,$(findstring avx,$(AVX1_M)))
|
| 116 |
+
CFLAGS += -mavx
|
| 117 |
+
endif
|
| 118 |
endif
|
| 119 |
else
|
| 120 |
CFLAGS += -mfma -mf16c -mavx -mavx2
|