io-chess
UCI chess engine
Loading...
Searching...
No Matches
BatchEvalContext.h
Go to the documentation of this file.
1
6#pragma once
7// BatchEvalContext.h - Wrapper for search threads to use BatchEvaluator
8// Provides the same IEvaluator interface but submits to batch queue
9
10#include "BatchEvaluator.h"
11#include "IEvaluator.h"
12
14private:
15 BatchEvaluator &batchEvaluator_;
16
17public:
18 explicit BatchEvalContext(BatchEvaluator &batchEval)
19 : batchEvaluator_(batchEval) {}
20
21 // Submit to batch queue and wait for result
22 float evaluate(const Board &board, int ply = 0) override {
23 (void)ply;
24 auto future = batchEvaluator_.submit(board);
25 return future.get(); // Block until result is ready
26 }
27
28 // Submit pre-computed inputs to batch queue
29 float evaluate(const ChessInput &input) override {
30 auto future = batchEvaluator_.submit(input);
31 return future.get();
32 }
33};
Abstract interface for board evaluation algorithms.
chess::Board Board
Alias for chess::Board.
Definition Types.h:14
BatchEvalContext(BatchEvaluator &batchEval)
Definition BatchEvalContext.h:18
float evaluate(const ChessInput &input) override
Evaluates the position using pre-computed features.
Definition BatchEvalContext.h:29
float evaluate(const Board &board, int ply=0) override
Evaluates the board from the perspective of the side to move.
Definition BatchEvalContext.h:22
BatchEvaluator & batchEvaluator_
Definition BatchEvalContext.h:15
Abstract interface for evaluators.
Definition IEvaluator.h:25
Definition FeatureExtractor.hpp:10