3 Copyright (c) Scott Gasch
11 Engine speed benchmarking code. This is the same test that crafty
20 $Id: bench.c 345 2007-12-02 22:56:42Z scott $
35 (hidden) CHAR *szInput
38 (hidden) POSITION *pos
44 typedef struct _BENCH_NODE
50 static BENCH_NODE x[] =
53 "3r1k2/4npp1/1ppr3p/p6P/P2PPPP1/1NR5/5K2/2R5 w - - 0 0", 11
56 "rnbqkb1r/p3pppp/1p6/2ppP3/3N4/2P5/PPP1QPPP/R1B1KB1R w KQkq - 0 0", 11
59 "4b3/p3kp2/6p1/3pP2p/2pP1P2/4K1P1/P3N2P/8 w - - 0 0", 13
62 "r3r1k1/ppqb1ppp/8/4p1NQ/8/2P5/PP3PPP/R3R1K1 b - - 0 0", 11
65 "2r2rk1/1bqnbpp1/1p1ppn1p/pP6/N1P1P3/P2B1N1P/1B2QPP1/R2R2K1 b - - 0 0", 11
68 "r1bqk2r/pp2bppp/2p5/3pP3/P2Q1P2/2N1B3/1PP3PP/R4RK1 b kq - 0 0", 11
77 Trace("You know this is a DEBUG build, right?\n");
79 dStart = SystemTimeStamp();
81 u < ARRAY_LENGTH(x) && (FALSE == g_fExitProgram);
84 VERIFY(PreGameReset(FALSE));
85 VERIFY(SetRootPosition(x[u].szFen));
86 pos = GetRootPosition();
87 g_Options.u64NodesSearched = 0ULL;
88 g_Options.uMaxDepth = x[u].uDepth;
90 u64Nodes += g_Options.u64NodesSearched;
92 dEnd = SystemTimeStamp();
93 ASSERT(dStart < dEnd);
96 Trace("Searched %"COMPILER_LONGLONG_UNSIGNED_FORMAT
97 " nodes in %4.1f sec.\n", u64Nodes, (dEnd - dStart));
98 Trace("BENCHMARK>> %8.1f nodes/sec\n", (double)u64Nodes / (dEnd - dStart));
99 VERIFY(PreGameReset(TRUE));