|
io-chess
UCI chess engine
|
A generic thread pool used for intra-evaluation parallelism and batch processing. More...
#include <PersistentThreadPool.hpp>
Classes | |
| struct | Job |
Public Member Functions | |
| PersistentThreadPool (int workers) | |
| ~PersistentThreadPool () | |
| PersistentThreadPool (const PersistentThreadPool &)=delete | |
| PersistentThreadPool & | operator= (const PersistentThreadPool &)=delete |
| void | parallel_for (int n, const std::function< void(int)> &fn) |
Private Member Functions | |
| void | worker_loop () |
Static Private Member Functions | |
| static void | finish_one (const std::shared_ptr< Job > &job) |
| static void | run_job (const std::shared_ptr< Job > &job) |
Private Attributes | |
| std::vector< std::thread > | threads_ |
| std::mutex | mu_ |
| std::condition_variable | cv_ |
| std::queue< std::shared_ptr< Job > > | jobs_ |
| bool | stop_ = false |
A generic thread pool used for intra-evaluation parallelism and batch processing.
This thread pool is used by the MoEDoubleAccumulator in the core engine when the UCI EvalThreads option is set to >1. It parallelizes the evaluation of the neural network's internal spatial branches.
It is also used heavily by the standalone benchmark tools in src/tools/ to evaluate massive batches of positions simultaneously.
|
inlineexplicit |


|
inline |
|
delete |

|
inlinestaticprivate |

|
delete |

|
inline |

|
inlinestaticprivate |


|
inlineprivate |


|
private |
|
private |
|
private |
|
private |
|
private |