diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-07-12 20:25:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-12 20:25:28 +0100 |
commit | 0c199442187d1e61697f33a0a99afb884e005fa9 (patch) | |
tree | 64b5ba8aea003f71acd55a6b3c3b16ff93d24e8f | |
parent | d3150bf0a5180f6f36ecbb42d416994cc6fac88d (diff) | |
parent | 90db7e9eb9b04c5b8bdabfb24d94ffd97041821e (diff) | |
download | xmr-stak-0c199442187d1e61697f33a0a99afb884e005fa9.zip xmr-stak-0c199442187d1e61697f33a0a99afb884e005fa9.tar.gz |
Merge pull request #211 from psychocrypt/topic-hwloc-clean
fix wrong cache method
-rw-r--r-- | autoAdjustHwloc.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/autoAdjustHwloc.hpp b/autoAdjustHwloc.hpp index 5e010a2..f6711fb 100644 --- a/autoAdjustHwloc.hpp +++ b/autoAdjustHwloc.hpp @@ -111,7 +111,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 @@ -141,7 +141,7 @@ private: } size_t cacheSize = obj->attr->cache.size; - if(!isCacheExclusive(obj)) + if(isCacheExclusive(obj)) { for(size_t i=0; i < obj->arity; i++) { @@ -156,7 +156,7 @@ private: cores.reserve(16); findChildrenByType(obj, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); } ); - size_t cacheHashes = (cacheSize + hashSize - 1) / hashSize; + size_t cacheHashes = (cacheSize + hashSize/2u - 1) / hashSize; //Firstly allocate PU 0 of every CORE, then PU 1 etc. size_t pu_id = 0; |