mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-09-30 03:21:18 +02:00
build : detect AVX512 in Makefile, add AVX512 option in CMake (#2043)
* make : add AVX512 detection to Makefile and CMakeLists.txt * make : autodetect more AVX512 instruction subsets * cmake : do not default to AVX512, must be enabled explicitly * cmake : enable a set of AVX512 subsets, when AVX512 is turned on * make : consolidate AVX512 subsets, add AVX512 VBMI * cmake : revert to NO AVX512 setting, add settings for AVX512 VNNI and VBMI * make : re-introduce AVX512VNNI back * cmake : remove superfluous comment line
This commit is contained in:
@@ -144,6 +144,24 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686 amd64))
|
||||
CXXFLAGS += -mavx2
|
||||
endif
|
||||
|
||||
AVX512F_M := $(shell $(CPUINFO_CMD) | grep -iw 'AVX512F')
|
||||
ifneq (,$(AVX512F_M))
|
||||
CFLAGS += -mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw
|
||||
CXXFLAGS += -mavx512f -mavx512cd -mavx512vl -mavx512dq -mavx512bw
|
||||
endif
|
||||
|
||||
AVX512VNNI_M := $(shell $(CPUINFO_CMD) | grep -iwE 'AVX512_VNNI|AVX512VNNI')
|
||||
ifneq (,$(AVX512VNNI_M))
|
||||
CFLAGS += -mavx512vnni
|
||||
CXXFLAGS += -mavx512vnni
|
||||
endif
|
||||
|
||||
AVX512VBMI_M := $(shell $(CPUINFO_CMD) | grep -iw 'AVX512VBMI')
|
||||
ifneq (,$(AVX512VBMI_M))
|
||||
CFLAGS += -mavx512vbmi
|
||||
CXXFLAGS += -mavx512vbmi
|
||||
endif
|
||||
|
||||
FMA_M := $(shell $(CPUINFO_CMD) | grep -iw 'FMA')
|
||||
ifneq (,$(FMA_M))
|
||||
CFLAGS += -mfma
|
||||
|
||||
Reference in New Issue
Block a user