fixed ucinewgame command, makefile bug in linux
This commit is contained in:
1 parent
4b1ce8f8ea
commit
8e6b8db124
4 files changed
+12
-17
No files matched your search
@@ -42,6 +42,6 @@ $(OBJ_DIR):
|
|||||||
# Clean up build artifacts
|
# Clean up build artifacts
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJ_DIR) 2>nul || $(DEL) $(OBJ_DIR)\* $(OBJ_DIR) 2>nul
|
$(RM) $(OBJ_DIR) || $(DEL) $(OBJ_DIR)\* $(OBJ_DIR)
|
||||||
$(RM) $(EXE)$(EXE_EXT) 2>nul || $(DEL) $(EXE)$(EXE_EXT) 2>nul
|
$(RM) $(EXE)$(EXE_EXT) || $(DEL) $(EXE)$(EXE_EXT)
|
||||||
$(MAKE)
|
$(MAKE)
|
||||||
+2
-2
@@ -55,8 +55,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Clear() {
|
void Clear() {
|
||||||
length[maxDepth] = {};
|
length[maxDepth - 1] = {};
|
||||||
table[maxDepth][maxDepth] = {};
|
table[maxDepth - 1][maxDepth - 1] = {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+8
-12
@@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
// 2[colors] * 6[pieces] * 64[squares]
|
// 2[colors] * 6[pieces] * 64[squares]
|
||||||
extern U64 zKeys[2][6][64];
|
extern U64 zKeys[2][6][64];
|
||||||
@@ -30,24 +29,21 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 256 MB
|
||||||
|
constexpr U64 maxHash = (256 * 1000000) / sizeof(TTEntry);
|
||||||
|
constexpr U64 defaultHash = (5 * 1000000) / sizeof(TTEntry);
|
||||||
|
|
||||||
// 5 MB
|
// 5 MB
|
||||||
inline int hashSize = (5 * 1000000) / sizeof(TTEntry);
|
inline U64 hashSize = defaultHash;
|
||||||
|
|
||||||
constexpr int invalidEntry = 111111;
|
constexpr int invalidEntry = 111111;
|
||||||
|
|
||||||
class TTable {
|
class TTable {
|
||||||
private:
|
private:
|
||||||
std::vector<TTEntry> table;
|
std::array<TTEntry, maxHash> table;
|
||||||
public:
|
public:
|
||||||
TTable() {
|
|
||||||
table.reserve(hashSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Resize(int size) {
|
|
||||||
table.resize(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Clear() {
|
void Clear() {
|
||||||
table.clear();
|
table.fill(TTEntry{});
|
||||||
}
|
}
|
||||||
|
|
||||||
TTEntry* GetRawEntry(U64 &hashKey) {
|
TTEntry* GetRawEntry(U64 &hashKey) {
|
||||||
|
|||||||
@@ -165,7 +165,6 @@ void ParseGo(Board &board, std::string &command) {
|
|||||||
static void SetOption(std::string &command) {
|
static void SetOption(std::string &command) {
|
||||||
if (command.find("Hash") != std::string::npos) {
|
if (command.find("Hash") != std::string::npos) {
|
||||||
hashSize = (ReadParam("value", command) * 1000000) / sizeof(TTEntry);
|
hashSize = (ReadParam("value", command) * 1000000) / sizeof(TTEntry);
|
||||||
TT.Resize(hashSize);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user