mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
ARCH=x86-64-avx2を指定できるようにした
This commit is contained in:
parent
76b0de40a1
commit
43e78187d7
2 changed files with 34 additions and 8 deletions
36
src/Makefile
36
src/Makefile
|
@ -96,6 +96,7 @@ bits = 32
|
|||
prefetch = no
|
||||
popcnt = no
|
||||
sse = no
|
||||
avx2 = no
|
||||
pext = no
|
||||
|
||||
### 2.2 Architecture specific
|
||||
|
@ -134,12 +135,22 @@ ifeq ($(ARCH),x86-64-modern)
|
|||
sse = yes
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86-64-avx2)
|
||||
arch = x86_64
|
||||
bits = 64
|
||||
prefetch = yes
|
||||
popcnt = yes
|
||||
sse = yes
|
||||
avx2 = yes
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86-64-bmi2)
|
||||
arch = x86_64
|
||||
bits = 64
|
||||
prefetch = yes
|
||||
popcnt = yes
|
||||
sse = yes
|
||||
avx2 = yes
|
||||
pext = yes
|
||||
endif
|
||||
|
||||
|
@ -336,11 +347,18 @@ endif
|
|||
### 3.6 popcnt
|
||||
ifeq ($(popcnt),yes)
|
||||
ifeq ($(arch),ppc64)
|
||||
CXXFLAGS += -DUSE_POPCNT
|
||||
CXXFLAGS += -DUSE_POPCNT -DUSE_SSE2
|
||||
else ifeq ($(comp),icc)
|
||||
CXXFLAGS += -msse3 -DUSE_POPCNT
|
||||
CXXFLAGS += -msse3 -DUSE_POPCNT -DUSE_SSE2
|
||||
else
|
||||
CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
|
||||
CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE2
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(avx2),yes)
|
||||
CXXFLAGS += -DUSE_AVX2
|
||||
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
|
||||
CXXFLAGS += -mavx2
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -348,7 +366,7 @@ endif
|
|||
ifeq ($(pext),yes)
|
||||
CXXFLAGS += -DUSE_PEXT
|
||||
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
|
||||
CXXFLAGS += -mbmi2 -mavx2
|
||||
CXXFLAGS += -mbmi2
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -400,6 +418,7 @@ help:
|
|||
@echo "Supported archs:"
|
||||
@echo ""
|
||||
@echo "x86-64-bmi2 > x86 64-bit with pext support (also enables SSE4)"
|
||||
@echo "x86-64-avx2 > x86 64-bit with avx2 support (also enables SSE4)"
|
||||
@echo "x86-64-modern > x86 64-bit with popcnt support (also enables SSE3)"
|
||||
@echo "x86-64 > x86 64-bit generic"
|
||||
@echo "x86-32 > x86 32-bit (also enables SSE)"
|
||||
|
@ -495,6 +514,7 @@ config-sanity:
|
|||
@echo "prefetch: '$(prefetch)'"
|
||||
@echo "popcnt: '$(popcnt)'"
|
||||
@echo "sse: '$(sse)'"
|
||||
@echo "avx2: '$(avx2)'"
|
||||
@echo "pext: '$(pext)'"
|
||||
@echo ""
|
||||
@echo "Flags:"
|
||||
|
@ -556,16 +576,16 @@ icc-profile-use:
|
|||
all
|
||||
|
||||
nnue: config-sanity
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_NNUE -DUSE_EVAL_HASH -DUSE_AVX2 -DUSE_SSE2 -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_NNUE -DUSE_EVAL_HASH -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
|
||||
nnue-gen-sfen-from-original-eval: config-sanity
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DUSE_EVAL_HASH -DUSE_AVX2 -DUSE_SSE2 -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DUSE_EVAL_HASH -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
|
||||
nnue-learn: config-sanity
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DEVAL_NNUE -DUSE_EVAL_HASH -DUSE_AVX2 -DUSE_SSE2 -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DEVAL_NNUE -DUSE_EVAL_HASH -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build
|
||||
|
||||
nnue-learn-use-blas: config-sanity
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DEVAL_NNUE -DUSE_EVAL_HASH -DUSE_AVX2 -DUSE_SSE2 -DENABLE_TEST_CMD -DUSE_BLAS -I/mingw64/include/OpenBLAS -fopenmp' LDFLAGS='$(LDFLAGS) -lopenblas -fopenmp' build
|
||||
$(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DEVAL_NNUE -DUSE_EVAL_HASH -DENABLE_TEST_CMD -DUSE_BLAS -I/mingw64/include/OpenBLAS -fopenmp' LDFLAGS='$(LDFLAGS) -lopenblas -fopenmp' build
|
||||
|
||||
.depend:
|
||||
-@$(CXX) $(DEPENDFLAGS) -MM $(OBJS:.o=.cpp) > $@ 2> /dev/null
|
||||
|
|
|
@ -5,6 +5,12 @@
|
|||
|
||||
#if defined(EVAL_NNUE)
|
||||
|
||||
#if defined(USE_AVX2)
|
||||
#include <immintrin.h>
|
||||
#elif defined(USE_SSE2)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
namespace Eval {
|
||||
|
||||
namespace NNUE {
|
||||
|
|
Loading…
Add table
Reference in a new issue