Index: runtime/src/kmp_affinity.h =================================================================== --- runtime/src/kmp_affinity.h +++ runtime/src/kmp_affinity.h @@ -248,17 +248,16 @@ __kmp_free(mask); } void set(int i) override { - mask[i / BITS_PER_MASK_T] |= ((mask_t)1 << (i % BITS_PER_MASK_T)); + CPU_SET(i, (cpu_set_t*)mask); } bool is_set(int i) const override { - return (mask[i / BITS_PER_MASK_T] & ((mask_t)1 << (i % BITS_PER_MASK_T))); + return CPU_ISSET(i, (cpu_set_t*)mask); } void clear(int i) override { - mask[i / BITS_PER_MASK_T] &= ~((mask_t)1 << (i % BITS_PER_MASK_T)); + CPU_CLR(i, (cpu_set_t*)mask); } void zero() override { - for (size_t i = 0; i < __kmp_affin_mask_size; ++i) - mask[i] = 0; + CPU_ZERO((cpu_set_t*)mask); } void copy(const KMPAffinity::Mask *src) override { const Mask *convert = static_cast(src); @@ -267,13 +266,11 @@ } void bitwise_and(const KMPAffinity::Mask *rhs) override { const Mask *convert = static_cast(rhs); - for (size_t i = 0; i < __kmp_affin_mask_size; ++i) - mask[i] &= convert->mask[i]; + CPU_AND((cpu_set_t*)mask, (cpu_set_t*)mask, (cpu_set_t*)(convert->mask)); } void bitwise_or(const KMPAffinity::Mask *rhs) override { const Mask *convert = static_cast(rhs); - for (size_t i = 0; i < __kmp_affin_mask_size; ++i) - mask[i] |= convert->mask[i]; + CPU_OR((cpu_set_t*)mask, (cpu_set_t*)mask, (cpu_set_t*)(convert->mask)); } void bitwise_not() override { for (size_t i = 0; i < __kmp_affin_mask_size; ++i)