From dcaa25fd7044667f8fab11c5b34eac2d5a027ff7 Mon Sep 17 00:00:00 2001 From: fireice-uk Date: Sun, 9 Jul 2017 22:28:52 +0100 Subject: [PATCH] Fix exclusive cache detection --- autoAdjustHwloc.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoAdjustHwloc.hpp b/autoAdjustHwloc.hpp index 8e4acd4..bb7d18c 100644 --- a/autoAdjustHwloc.hpp +++ b/autoAdjustHwloc.hpp @@ -87,10 +87,10 @@ private: } } - inline bool isCacheInclusive(hwloc_obj_t obj) + inline bool isCacheExclusive(hwloc_obj_t obj) { const char* value = hwloc_obj_get_info_by_name(obj, "Inclusive"); - return value == nullptr || value[0] == '1'; + return value == nullptr || value[0] != '1'; } // Top level cache isn't shared with other cores on the same package @@ -120,7 +120,7 @@ private: } size_t cacheSize = obj->attr->cache.size; - if(!isCacheInclusive(obj)) + if(isCacheExclusive(obj)) { for(size_t i=0; i < obj->arity; i++) {