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