|
io-chess
UCI chess engine
|
Model manager that shares native weights across threads. More...
#include <Evaluator.h>
Public Member Functions | |
| Evaluator (const std::string &modelPath, int numThreads, bool useGPU=false) | |
| Constructs an Evaluator manager. | |
| std::unique_ptr< IEvaluator > | createThreadContext () |
| Creates a lightweight thread context from the shared model. | |
| bool | isLoaded () const |
| bool | isMoE () const |
| bool | isMoECache () const |
Private Attributes | |
| std::string | modelPath_ |
| std::string | nativeWeightsPath_ |
| int | numThreads_ |
| bool | isMoECache_ |
| bool | useGPU_ |
| std::shared_ptr< const EvalContextMoECacheSharedModel > | sharedMoECacheModel_ |
| Shared native model used by all thread contexts. | |
Model manager that shares native weights across threads.
It is responsible for loading the neural network architecture (or falling back to simple evaluation) and instantiating thread-local IEvaluator contexts that share the read-only weights to save memory.
| Evaluator::Evaluator | ( | const std::string & | modelPath, |
| int | numThreads, | ||
| bool | useGPU = false ) |
Constructs an Evaluator manager.
| modelPath | Path to the network weights file. |
| numThreads | Number of threads that will request contexts. |
| useGPU | Whether to accelerate evaluation using the GPU (if supported). |

| std::unique_ptr< IEvaluator > Evaluator::createThreadContext | ( | ) |
Creates a lightweight thread context from the shared model.

|
inline |

|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
Shared native model used by all thread contexts.
|
private |