From 24ba204931901c26960a97f07e3344b6d62b883f Mon Sep 17 00:00:00 2001 From: lucasart Date: Tue, 1 Jul 2014 18:13:20 +0800 Subject: [PATCH] Raise max Hash to 1TB And use size_t where appropriate, as suggested on FishCooking. No functional change. --- src/tt.cpp | 6 ++---- src/tt.h | 4 ++-- src/ucioption.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/tt.cpp b/src/tt.cpp index 248cbad9..46d891cd 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -30,11 +30,9 @@ TranspositionTable TT; // Our global transposition table /// measured in megabytes. Transposition table consists of a power of 2 number /// of clusters and each cluster consists of TTClusterSize number of TTEntry. -void TranspositionTable::resize(uint64_t mbSize) { +void TranspositionTable::resize(size_t mbSize) { - assert(msb((mbSize * 1024 * 1024) / sizeof(TTCluster)) < 32); - - uint32_t newClusterCount = 1 << msb((mbSize * 1024 * 1024) / sizeof(TTCluster)); + size_t newClusterCount = size_t(1) << msb((mbSize * 1024 * 1024) / sizeof(TTCluster)); if (newClusterCount == clusterCount) return; diff --git a/src/tt.h b/src/tt.h index e9c25ad2..c4422052 100644 --- a/src/tt.h +++ b/src/tt.h @@ -89,12 +89,12 @@ public: const TTEntry* probe(const Key key) const; TTEntry* first_entry(const Key key) const; - void resize(uint64_t mbSize); + void resize(size_t mbSize); void clear(); void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV); private: - uint32_t clusterCount; + size_t clusterCount; TTCluster* table; void* mem; uint8_t generation; // Size must be not bigger than TTEntry::genBound8 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index ed46d71e..5833ef7b 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -60,7 +60,7 @@ void init(OptionsMap& o) { o["Contempt Factor"] << Option(0, -50, 50); o["Min Split Depth"] << Option(0, 0, 12, on_threads); o["Threads"] << Option(1, 1, MAX_THREADS, on_threads); - o["Hash"] << Option(32, 1, 16384, on_hash_size); + o["Hash"] << Option(32, 1, 1024 * 1024, on_hash_size); o["Clear Hash"] << Option(on_clear_hash); o["Ponder"] << Option(true); o["MultiPV"] << Option(1, 1, 500); -- 2.39.2