X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=bf8143a33462780ac15e61fb3b9ddd4b6b8bc420;hp=06339d21ec14c24160cbf67e5c5e43873425a605;hb=0980f43ab06611c6eb0fb4c112551e9c40254a23;hpb=aaa07fb161c6287aafe8c5532335d4034c816f5e diff --git a/src/misc.cpp b/src/misc.cpp index 06339d21..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"; +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;