Obtain actual cpu count on AIX and suppress spurious NO_AVX512 on non-x86

This commit is contained in:
Martin Kroeker 2020-07-07 15:46:32 +02:00 committed by GitHub
parent c854ef5471
commit 8751a69271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -90,11 +90,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/sysinfo.h>
#include <unistd.h>
#endif
#if defined(AIX)
#include <sys/sysinfo.h>
#endif
#if defined(__x86_64__) || defined(_M_X64)
#if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6))
#else
#define NO_AVX512
#endif
#endif
/* #define FORCE_P2 */
/* #define FORCE_KATMAI */
/* #define FORCE_COPPERMINE */
@ -1297,6 +1302,11 @@ static int get_num_cores(void) {
sysctl(m, 2, &count, &len, NULL, 0);
return count;
#elif defined(AIX)
//returns the number of processors which are currently online
return sysconf(_SC_NPROCESSORS_ONLN);
#else
return 2;
#endif