3#ifndef OSL_DFPNPARALLEL_H
4#define OSL_DFPNPARALLEL_H
42 for (
int i=0; i<32; ++i)
43 if ((1u << i) & threads) {
45 if (!
data[i].restart ||
data[i].depth > depth) {
46 data[i].restart_key = key;
47 data[i].depth = depth;
48 data[i].restart =
true;
55 for (
size_t i=0; i<
data.size(); ++i)
62 DfpnParallel(
const DfpnParallel&) =
delete;
63 DfpnParallel& operator=(
const DfpnParallel&) =
delete;
66 boost::scoped_array<Dfpn> workers;
80 boost::scoped_array<WorkerData> worker_data;
83 explicit DfpnParallel(
size_t num_threads=0);
85 void setTable(DfpnTable *new_table);
88 hasCheckmateMove(
const NumEffectState& state,
const HashKey& key,
90 Move last_move=Move::INVALID(), std::vector<Move> *pv=0);
92 hasCheckmateMove(
const NumEffectState& state,
const HashKey& key,
93 const PathEncoding& path,
size_t limit, Move& best_move, PieceStand& proof,
94 Move last_move=Move::INVALID(), std::vector<Move> *pv=0);
96 hasEscapeMove(
const NumEffectState& state,
98 size_t limit, Move last_move);
100 size_t nodeCount()
const;
101 const DfpnTable& currentTable()
const {
return *table; }
103 const NumEffectState& state,
const std::vector<Move>& moves)
const;
107 shared.stop_all =
true;
111 struct DefenseWorker;
112 friend struct AttackWorker;
113 friend struct DefenseWorker;
CArray< ThreadData, 32 > data
void restartThreads(const HashKey &key, int depth, unsigned int threads)
証明数(proof number)と反証数(disproof number).
#define SCOPED_LOCK(lock, m)
const PtypeO PTYPEO_EDGE __attribute__((unused))