ensapsulated nodes | bench 1857933
This commit is contained in:
1 parent
6027dbd377
commit
eff4f50ee8
6 files changed
+56
-45
No files matched your search
+6
-4
@@ -68,7 +68,7 @@ static int ReadParam(std::string param, std::string &command) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ParseGo(Board &board, std::string &command) {
|
||||
static void ParseGo(Board &board, std::string &command, SEARCH::SearchContext& ctx) {
|
||||
SearchParams params;
|
||||
|
||||
params.wtime = ReadParam("wtime", command);
|
||||
@@ -84,10 +84,10 @@ static void ParseGo(Board &board, std::string &command) {
|
||||
}
|
||||
|
||||
if (params.nodes) {
|
||||
auto worker = std::thread(SEARCH::SearchPosition<SEARCH::nodesMode>, std::ref(board), params);
|
||||
auto worker = std::thread(SEARCH::SearchPosition<SEARCH::nodesMode>, std::ref(board), params, std::ref(ctx));
|
||||
worker.detach();
|
||||
} else {
|
||||
auto worker = std::thread(SEARCH::SearchPosition<SEARCH::normal>, std::ref(board), params);
|
||||
auto worker = std::thread(SEARCH::SearchPosition<SEARCH::normal>, std::ref(board), params, std::ref(ctx));
|
||||
worker.detach();
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,8 @@ static void PrintEngineInfo() {
|
||||
void UCILoop(Board &board) {
|
||||
std::string input = "";
|
||||
|
||||
SEARCH::SearchContext ctx;
|
||||
|
||||
// main loop
|
||||
while (true) {
|
||||
std::getline(std::cin, input);
|
||||
@@ -144,7 +146,7 @@ void UCILoop(Board &board) {
|
||||
|
||||
// parse UCI "go" command
|
||||
if (input.find("go") != std::string::npos) {
|
||||
ParseGo(board, input);
|
||||
ParseGo(board, input, ctx);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user