diff options
author | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-24 21:27:01 +0200 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-27 20:12:38 +0200 |
commit | 41451d91e8e50f2b6c4b07630987dbc5a58aecb9 (patch) | |
tree | 8d80830627ab256365434c649ddf9e0ceb93dca0 /xmrstak/backend/cpu/autoAdjustHwloc.hpp | |
parent | 89749c32b736fd581d66441e93ca71c39707fcb2 (diff) | |
download | xmr-stak-41451d91e8e50f2b6c4b07630987dbc5a58aecb9.zip xmr-stak-41451d91e8e50f2b6c4b07630987dbc5a58aecb9.tar.gz |
add aeon support to backend cpu
- update auto suggestion default and hwloc
- extent hash function table to support aeon and xmr within one miner
Diffstat (limited to 'xmrstak/backend/cpu/autoAdjustHwloc.hpp')
-rw-r--r-- | xmrstak/backend/cpu/autoAdjustHwloc.hpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/xmrstak/backend/cpu/autoAdjustHwloc.hpp b/xmrstak/backend/cpu/autoAdjustHwloc.hpp index ad3b863..b6f84c4 100644 --- a/xmrstak/backend/cpu/autoAdjustHwloc.hpp +++ b/xmrstak/backend/cpu/autoAdjustHwloc.hpp @@ -3,6 +3,7 @@ #include "xmrstak/misc/console.hpp" #include "xmrstak/misc/configEditor.hpp" #include "xmrstak/params.hpp" +#include "../cryptonight.hpp" #ifdef _WIN32 #include <windows.h> @@ -27,6 +28,16 @@ public: autoAdjust() { + if(::jconf::inst()->IsCurrencyXMR()) + { + hashMemSize = XMR_MEMORY; + halfHashMemSize = hashMemSize / 2u; + } + else + { + hashMemSize = AEON_MEMORY; + halfHashMemSize = hashMemSize / 2u; + } } bool printConfig() @@ -86,7 +97,9 @@ public: } private: - static constexpr size_t hashSize = 2 * 1024 * 1024; + size_t hashMemSize; + size_t halfHashMemSize; + std::vector<uint32_t> results; template<typename func> @@ -161,8 +174,8 @@ private: { hwloc_obj_t l2obj = obj->children[i]; //If L2 is exclusive and greater or equal to 2MB add room for one more hash - if(isCacheObject(l2obj) && l2obj->attr != nullptr && l2obj->attr->cache.size >= hashSize) - cacheSize += hashSize; + if(isCacheObject(l2obj) && l2obj->attr != nullptr && l2obj->attr->cache.size >= hashMemSize) + cacheSize += hashMemSize; } } @@ -170,7 +183,7 @@ private: cores.reserve(16); findChildrenByType(obj, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); } ); - size_t cacheHashes = (cacheSize + hashSize/2) / hashSize; + size_t cacheHashes = (cacheSize + halfHashMemSize) / hashMemSize; //Firstly allocate PU 0 of every CORE, then PU 1 etc. size_t pu_id = 0; |