Fix bitmask upper bounds check
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 12 Sep 2016 19:02:53 +0000 (19:02 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 12 Sep 2016 19:02:53 +0000 (19:02 +0000)
commit7c465a5f41f5e862bb6438a93c34fa089e5dd109
tree26eb14949731a60e7304a78f285cd0805b4a7256
parent5730bf04292dfeed06b3717a32b26acaa1690c69
Fix bitmask upper bounds check

Rather than checking KMP_CPU_SETSIZE, which doesn't exist when using Hwloc, we
use the get_max_proc() function which can vary based on the operating system.
For example on Windows with multiple processor groups, it might be the case that
the highest bit possible in the bitmask is not equal to the number of hardware
threads on the machine but something higher than that.

Differential Revision: https://reviews.llvm.org/D24206

llvm-svn: 281245
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_affinity.cpp
openmp/runtime/src/kmp_ftn_entry.h