changed raw ctx pointer to unique | bench 3415609

This commit is contained in:
rektdie committed 2025-06-06 06:18:57 +02:00
1 parent b1fd8e6021
commit dec219e4d7
3 files changed
+13 -12

No files matched your search

+3 -2
View File
@@ -1,6 +1,7 @@
#include <cstring>
#include <string_view>
#include <array>
#include <memory>
#include "benchmark.h"
#include "search.h"
#include "stopwatch.h"
@@ -64,12 +65,12 @@ void RunBenchmark() {
Board board;
int depth = BENCH_DEPTH;
SEARCH::SearchContext *ctx = new SearchContext();
auto ctx = std::make_unique<SearchContext>();
Stopwatch sw;
for (int i = 0; i < fenPositions.size(); i++) {
board.SetByFen(fenPositions[i]);
SearchPosition<bench>(board, SearchParams(), ctx);
SearchPosition<bench>(board, SearchParams(), ctx.get());
}
std::cout << ctx->nodes << " nodes " << int(ctx->nodes/sw.GetElapsedSec()) << " nps" << std::endl;