Changeset View
Changeset View
Standalone View
Standalone View
runtime/src/kmp_affinity.cpp
Show First 20 Lines • Show All 1,016 Lines • ▼ Show 20 Lines | KMP_CPU_SET_ITERATE(i, __kmp_affin_fullMask) { | ||||
__kmp_affinity_dispatch->bind_thread(i); | __kmp_affinity_dispatch->bind_thread(i); | ||||
threadInfo[nApics].osId = i; | threadInfo[nApics].osId = i; | ||||
// | // | ||||
// The apic id and max threads per pkg come from cpuid(1). | // The apic id and max threads per pkg come from cpuid(1). | ||||
// | // | ||||
__kmp_x86_cpuid(1, 0, &buf); | __kmp_x86_cpuid(1, 0, &buf); | ||||
if (! (buf.edx >> 9) & 1) { | if (! ((buf.edx >> 9) & 1)) { | ||||
__kmp_set_system_affinity(oldMask, TRUE); | __kmp_set_system_affinity(oldMask, TRUE); | ||||
__kmp_free(threadInfo); | __kmp_free(threadInfo); | ||||
KMP_CPU_FREE(oldMask); | KMP_CPU_FREE(oldMask); | ||||
*msg_id = kmp_i18n_str_ApicNotPresent; | *msg_id = kmp_i18n_str_ApicNotPresent; | ||||
return -1; | return -1; | ||||
} | } | ||||
threadInfo[nApics].apicId = (buf.ebx >> 24) & 0xff; | threadInfo[nApics].apicId = (buf.ebx >> 24) & 0xff; | ||||
threadInfo[nApics].maxThreadsPerPkg = (buf.ebx >> 16) & 0xff; | threadInfo[nApics].maxThreadsPerPkg = (buf.ebx >> 16) & 0xff; | ||||
▲ Show 20 Lines • Show All 3,884 Lines • Show Last 20 Lines |