From 961047ed6ec3f251f9c05c494efc0cdbc3dd30c6 Mon Sep 17 00:00:00 2001 From: No name Date: Wed, 15 Jul 2020 22:52:27 +0300 Subject: [PATCH] Experimental support for PGO builds of NNUE Only 'nnue' target and only gcc/mingw. (does not clean profile data generated by other compilers) To use: make profile-nnue ARCH=arch (see 'make help' for list of supported archs) --- src/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 1c3645b6..585d93a4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -211,7 +211,7 @@ endif ### ========================================================================== ### 3.1 Selecting compiler (default = gcc) -CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS) +CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS) $(NNUECXXFLAGS) DEPENDFLAGS += -std=c++17 LDFLAGS += $(EXTRALDFLAGS) @@ -569,7 +569,7 @@ objclean: # clean auxiliary profiling files profileclean: @rm -rf profdir - @rm -f bench.txt *.gcda *.gcno + @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./learn/*.gcda ./extra/*.gcda ./eval/*.gcda ./eval/nnue/*.gcda ./eval/nnue/features/*.gcda @rm -f stockfish.profdata *.profraw default: @@ -666,6 +666,10 @@ icc-profile-use: nnue: config-sanity $(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_NNUE -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build +profile-nnue: export NNUECXXFLAGS = -DEVAL_NNUE -DENABLE_TEST_CMD +profile-nnue: config-sanity + $(MAKE) profile-build + nnue-gen-sfen-from-original-eval: config-sanity $(MAKE) CXXFLAGS='$(CXXFLAGS) -DEVAL_LEARN -DUSE_EVAL_HASH -DENABLE_TEST_CMD -fopenmp' LDFLAGS='$(LDFLAGS) -fopenmp' build