X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=bf8143a33462780ac15e61fb3b9ddd4b6b8bc420;hp=6198b072a161b1dd0398647a511df11c74d7b8c4;hb=0980f43ab06611c6eb0fb4c112551e9c40254a23;hpb=8ee0842c81ba41482d3373d4174bfed53b1bc9fc diff --git a/src/misc.cpp b/src/misc.cpp index 6198b072..bf8143a3 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -27,6 +27,9 @@ # include # include # include +# if defined(__hpux) +# include +# endif #else @@ -50,7 +53,7 @@ using namespace std; /// Version number. If this is left empty, the current date (in the format /// YYMMDD) is used as a version number. -static const string EngineVersion = "1.5.1"; +static const string EngineVersion = ""; static const string AppName = "Stockfish"; static const string AppTag = ""; @@ -187,6 +190,14 @@ int get_system_time() { int cpu_count() { return Min(sysconf(_SC_NPROCESSORS_ONLN), 8); } +# elif defined(__hpux) +int cpu_count() { + struct pst_dynamic psd; + if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1) + return 1; + + return Min(psd.psd_proc_cnt, 8); +} # else int cpu_count() { return 1;