Makefile: support LLAMA_AVX2_ONLY.

This commit is contained in:
Bryan Silverthorn 2023-05-05 10:48:13 -07:00
parent 34d9f22f44
commit 2e3b2e7e09

View file

@ -78,13 +78,14 @@ endif
# TODO: probably these flags need to be tweaked on some architectures
# feel free to update the Makefile for your architecture and send a pull request or issue
ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686))
# Use all CPU extensions that are available:
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
# Usage AVX-only
#CFLAGS += -mfma -mf16c -mavx
#CXXFLAGS += -mfma -mf16c -mavx
ifdef LLAMA_AVX2_ONLY
CFLAGS += -mfma -mf16c -mavx2
CXXFLAGS += -mfma -mf16c -mavx2
else
# Use all CPU extensions that are available:
CFLAGS += -march=native -mtune=native
CXXFLAGS += -march=native -mtune=native
endif
endif
ifneq ($(filter ppc64%,$(UNAME_M)),)
POWER9_M := $(shell grep "POWER9" /proc/cpuinfo)