File tree Expand file tree Collapse file tree 5 files changed +58
-5
lines changed
Expand file tree Collapse file tree 5 files changed +58
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Igel Linux Build PGO
2+
3+ on :
4+ push :
5+ branches :
6+ - ' **'
7+ pull_request :
8+ branches :
9+ - ' **'
10+ workflow_dispatch : # Allow manual triggering of the workflow
11+
12+ jobs :
13+ build :
14+ runs-on : ${{ matrix.os }}
15+
16+ strategy :
17+ matrix :
18+ os : [ ubuntu-latest ]
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v2
23+
24+ - name : Install GCC versions
25+ run : |
26+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
27+ sudo apt-get update
28+ sudo apt-get install -y gcc-12 g++-12 gcc-13 g++-13
29+
30+ - name : Set GCC version
31+ run : |
32+ # Set GCC 14 as the default version
33+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 60
34+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 60
35+
36+ - name : Build the PGO build
37+ run : cd src&&make pgo
38+
39+ - name : Run the bench
40+ run : cd src&&./igel bench
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ int main(int argc, const char* argv[])
4646
4747 Uci handler (*searcher.get ());
4848
49- if (argc == 2 && !strcmp (argv[1 ], " bench" ))
50- return handler.onBench ();
49+ if (!strcmp (argv[1 ], " bench" ))
50+ return handler.onBench (argv[ 2 ] );
5151 else
5252 return handler.handleCommands ();
5353}
Original file line number Diff line number Diff line change 3131
3232CFLAGS = $(WARN ) $(LIBS ) $(OPTIM ) $(NNFLAGS )
3333
34+ pgo : download-network
35+ $(CC ) $(CFLAGS ) $(SRC ) $(DEFS ) -fprofile-generate=pgo -o $(EXE )
36+ ./$(EXE ) bench 13 > pgo.out 2>&1
37+ $(CC ) $(CFLAGS ) $(SRC ) $(DEFS ) -fprofile-use=pgo -o $(EXE )
38+ @rm -rf pgo pgo.out weights
39+
3440basic :
3541 $(CC ) $(CFLAGS ) $(SRC ) $(DEFS ) -o $(EXE )
42+
43+ download-network :
44+ mkdir weights; \
45+ echo " Downloading latest Igel network with wget" ; wget -P weights https://github.com/vshcherbyna/igel/releases/download/3.5.0/c049c117;
Original file line number Diff line number Diff line change @@ -212,10 +212,13 @@ static const char* benchmarkPositions[] = {
212212 " "
213213};
214214
215- int Uci::onBench ()
215+ int Uci::onBench (const char * depth )
216216{
217217 std::cout << " Running benchmark" << std::endl;
218218
219+ if (!depth)
220+ depth = " 10" ;
221+
219222 auto & time = Time::instance ();
220223
221224 if (!TTable::instance ().setHashSize (16 , 1 )) {
@@ -229,7 +232,7 @@ int Uci::onBench()
229232
230233 uint64_t sumNodes = 0 ;
231234 auto start = GetProcTime ();
232- commandParams p = { " go" , " depth" , " 10 " };
235+ commandParams p = { " go" , " depth" , depth };
233236
234237 for (auto i = 0 ; strcmp (benchmarkPositions[i], " " ); i++) {
235238 if (!m_searcher.m_position .SetFEN (benchmarkPositions[i]))
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class Uci
5454
5555public:
5656 int handleCommands ();
57- int onBench ();
57+ int onBench (const char * depth );
5858 static commandParams split (const std::string & s, const std::string & sep = " " );
5959
6060private:
You can’t perform that action at this time.
0 commit comments