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