diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-07-10 21:43:21 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-07-10 21:43:21 +0200 |
commit | 71c40a49c32e77551a325f371a835904d626ca2e (patch) | |
tree | a4fb60d5ec86da59b5d3dec733c2459ee14ba45e | |
parent | 69f95e4e2d29c0dffa1e654aa10b25ac74e06d83 (diff) | |
download | xmr-stak-71c40a49c32e77551a325f371a835904d626ca2e.zip xmr-stak-71c40a49c32e77551a325f371a835904d626ca2e.tar.gz |
fix
- fix exclusive cache detection
- fix usage of wrong cache size
-rw-r--r-- | autoAdjustHwloc.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/autoAdjustHwloc.hpp b/autoAdjustHwloc.hpp index bb7d18c..c76cd5f 100644 --- a/autoAdjustHwloc.hpp +++ b/autoAdjustHwloc.hpp @@ -90,7 +90,7 @@ private: 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(isCacheExclusive(obj)) + if(!isCacheExclusive(obj)) { for(size_t i=0; i < obj->arity; i++) { @@ -135,7 +135,7 @@ private: cores.reserve(16); findChildrenByType(obj, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); } ); - size_t cacheHashes = (obj->attr->cache.size + hashSize - 1) / hashSize; + size_t cacheHashes = (cacheSize + hashSize - 1) / hashSize; //Firstly allocate PU 0 of every CORE, then PU 1 etc. size_t pu_id = 0; |