Skip to content

Commit

Permalink
Allow setting non default nets when compiling
Browse files Browse the repository at this point in the history
bench 4546084
  • Loading branch information
rn5f107s2 committed Jun 8, 2024
1 parent 4e9b087 commit 58b274a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ OBJ_DIR=build
MOLY_DIR=src
CXX=clang++

DEFAULT_NET_NAME=moly_20240526.nnue

DEFAULT_EXE = $(OBJ_DIR)/Molybdenum
DATAGEN_EXE = $(OBJ_DIR)/Datagen
DEFAULT_NET = $(MOLY_DIR)/Nets/$(DEFAULT_NET_NAME)

EVALFILE ?= $(DEFAULT_NET)

all: $(DEFAULT_EXE)

Expand All @@ -13,7 +18,7 @@ datagen: $(DATAGEN_EXE)
CXXFLAGS = -static -Ofast -std=c++17
CXXFLAGS += -Wall -Wextra -pedantic
CXXFLAGS += -march=native
CXXFLAGS += -DMAKEFILE
CXXFLAGS += -DEVALFILE=\"$(EVALFILE)\"

LDFLAGS += -static -Ofast -march=native

Expand Down
6 changes: 4 additions & 2 deletions src/nnue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
#undef PUSHED_MACRO
#endif

#define defaultNetPath "src/Nets/moly_20240526.nnue"
#ifndef EVALFILE
#define EVALFILE // silence syntax highlighting
#endif

INCBIN(network, defaultNetPath);
INCBIN(network, EVALFILE);
const Weights defaultWeights = *reinterpret_cast<const Weights*>(gnetworkData);

Net net;
Expand Down

0 comments on commit 58b274a

Please sign in to comment.