Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions library/src/quick_tricks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,6 @@ int QuickTricksPartnerHandNT(
return qt;
if ((countOwn <= 2) && (countLho <= 2) && (countRho <= 2))
{
// TODO: Is the fix to qt correct?
// qtricks += countPart - 2;
qt += countPart - 2;
if (qt >= cutoff)
return qt;
Expand Down
5 changes: 3 additions & 2 deletions library/src/solver_context/solver_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// SolverContext so callers can create a context at the top of the stack
// and pass it down without a separate per-thread lookup.
SolverContext::SolverContext(SolverConfig cfg)
: thr_(nullptr), cfg_(cfg) //TODO: remove thr_(nullptr) which is redundant
: cfg_(cfg)
{
// Create an owned ThreadData instance and keep it in thr_.
thr_ = std::make_shared<ThreadData>();
Expand Down Expand Up @@ -234,7 +234,8 @@ auto SolverContext::reset_best_moves_lite() const -> void

auto ThreadMemoryUsed() -> double
{
// TODO: Only needed because SolverIF wants to set it. Avoid?
// Fixed per-thread lookup-table memory (RelRanksType) included in memUsed
// reporting; legacy SolverIF uses the same accounting.
double memUsed =
8192 * sizeof(RelRanksType)
/ static_cast<double>(1024.);
Expand Down
10 changes: 6 additions & 4 deletions library/src/system/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include <cstring>
#include <thread>

#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
#include <unistd.h>
Expand Down Expand Up @@ -388,18 +389,19 @@ string System::get_constructor(int& cons) const

int System::get_cores() const
{
const unsigned int hw = std::thread::hardware_concurrency();
if (hw > 0)
return static_cast<int>(hw);

int cores = 0;
#if defined(_WIN32) || defined(__CYGWIN__)
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
cores = static_cast<int>(sysinfo.dwNumberOfProcessors);
#elif defined(__APPLE__) || defined(__linux__)
cores = sysconf(_SC_NPROCESSORS_ONLN);
cores = static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
#endif

// TODO Think about thread::hardware_concurrency().
// This should be standard in C++11.

return cores;
}

Expand Down
Loading