]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
make : fix Linux machines supporting AVX1 not AVX2 (#1162)
authorEric Swanson <redacted>
Fri, 25 Aug 2023 12:52:22 +0000 (08:52 -0400)
committerGitHub <redacted>
Fri, 25 Aug 2023 12:52:22 +0000 (15:52 +0300)
e.g. ancient CPU E5-2670 (v1)

See issue #1126

Co-authored-by: Georgi Gerganov <redacted>
Makefile

index 5d5e7ad7a0657f73e8b67fd94b9ef7ac44189bbf..9aba5e9ad4960cb06c93f76caff790dfecbdea3a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -74,7 +74,12 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
                CPUINFO_CMD := sysinfo -cpu
        endif
 
-       ifdef CPUINFO_CMD
+       ifdef CPUINFO_CMD       
+    AVX_M := $(shell $(CPUINFO_CMD) | grep -m 1 "avx ")
+               ifneq (,$(findstring avx,$(AVX_M)))
+                       CFLAGS += -mavx
+               endif
+    
                AVX2_M := $(shell $(CPUINFO_CMD) | grep -m 1 "avx2 ")
                ifneq (,$(findstring avx2,$(AVX2_M)))
                        CFLAGS += -mavx2