Obtain actual cpu count on AIX and suppress spurious NO_AVX512 on non-x86
This commit is contained in:
parent
c854ef5471
commit
8751a69271
10
getarch.c
10
getarch.c
|
@ -90,11 +90,16 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#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))
|
#if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6))
|
||||||
#else
|
#else
|
||||||
#define NO_AVX512
|
#define NO_AVX512
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
/* #define FORCE_P2 */
|
/* #define FORCE_P2 */
|
||||||
/* #define FORCE_KATMAI */
|
/* #define FORCE_KATMAI */
|
||||||
/* #define FORCE_COPPERMINE */
|
/* #define FORCE_COPPERMINE */
|
||||||
|
@ -1297,6 +1302,11 @@ static int get_num_cores(void) {
|
||||||
sysctl(m, 2, &count, &len, NULL, 0);
|
sysctl(m, 2, &count, &len, NULL, 0);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
||||||
|
#elif defined(AIX)
|
||||||
|
//returns the number of processors which are currently online
|
||||||
|
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return 2;
|
return 2;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue