3 #ifndef OSL_DFPNPARALLEL_H
4 #define OSL_DFPNPARALLEL_H
36 CArray<ThreadData, 32>
data;
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;
48 data[i].restart =
true;
55 for (
size_t i=0; i<
data.size(); ++i)
60 class DfpnParallel : boost::noncopyable
64 boost::scoped_array<Dfpn> workers;
67 const NumEffectState *state;
78 boost::scoped_array<WorkerData> worker_data;
81 explicit DfpnParallel(
size_t num_threads=0);
83 void setTable(DfpnTable *new_table);
86 hasCheckmateMove(
const NumEffectState& state,
const HashKey& key,
87 const PathEncoding& path,
size_t limit, Move& best_move,
90 hasCheckmateMove(
const NumEffectState& state,
const HashKey& key,
91 const PathEncoding& path,
size_t limit, Move& best_move, PieceStand& proof,
94 hasEscapeMove(
const NumEffectState& state,
95 const HashKey& key,
const PathEncoding& path,
96 size_t limit, Move last_move);
98 size_t nodeCount()
const;
99 const DfpnTable& currentTable()
const {
return *table; }
100 void analyze(
const PathEncoding& path,
101 const NumEffectState& state,
const vector<Move>&
moves)
const;
105 shared.stop_all =
true;
109 struct DefenseWorker;
110 friend struct AttackWorker;
111 friend struct DefenseWorker;