mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Don't ceil cpu_count()
It is already done at calling site where it is more appropiate. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
# include <xmmintrin.h>
|
# include <xmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@@ -174,16 +173,16 @@ int cpu_count() {
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
SYSTEM_INFO s;
|
SYSTEM_INFO s;
|
||||||
GetSystemInfo(&s);
|
GetSystemInfo(&s);
|
||||||
return std::min(int(s.dwNumberOfProcessors), MAX_THREADS);
|
return s.dwNumberOfProcessors;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# if defined(_SC_NPROCESSORS_ONLN)
|
# if defined(_SC_NPROCESSORS_ONLN)
|
||||||
return std::min((int)sysconf(_SC_NPROCESSORS_ONLN), MAX_THREADS);
|
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
# elif defined(__hpux)
|
# elif defined(__hpux)
|
||||||
struct pst_dynamic psd;
|
struct pst_dynamic psd;
|
||||||
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
|
if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1)
|
||||||
return 1;
|
return 1;
|
||||||
return std::min((int)psd.psd_proc_cnt, MAX_THREADS);
|
return psd.psd_proc_cnt;
|
||||||
# else
|
# else
|
||||||
return 1;
|
return 1;
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
Reference in New Issue
Block a user