mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 03:59:41 +00:00
Removed CnAlgo dependency from Algorithm class.
This commit is contained in:
parent
914b7023a2
commit
f19b2f7248
2 changed files with 18 additions and 23 deletions
|
@ -25,7 +25,6 @@
|
|||
|
||||
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "base/crypto/CnAlgo.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
|
@ -169,15 +168,26 @@ size_t xmrig::Algorithm::l2() const
|
|||
|
||||
size_t xmrig::Algorithm::l3() const
|
||||
{
|
||||
# if defined(XMRIG_ALGO_RANDOMX) || defined(XMRIG_ALGO_ARGON2) || defined(XMRIG_ALGO_ASTROBWT)
|
||||
constexpr size_t oneMiB = 0x100000;
|
||||
# endif
|
||||
|
||||
const Family f = family();
|
||||
const auto f = family();
|
||||
assert(f != UNKNOWN);
|
||||
|
||||
if (f < RANDOM_X) {
|
||||
return CnAlgo<>::memory(m_id);
|
||||
switch (f) {
|
||||
case CN:
|
||||
return oneMiB * 2;
|
||||
|
||||
case CN_LITE:
|
||||
return oneMiB;
|
||||
|
||||
case CN_HEAVY:
|
||||
return oneMiB * 4;
|
||||
|
||||
case CN_PICO:
|
||||
return oneMiB / 4;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
|
|
|
@ -53,24 +53,9 @@ public:
|
|||
|
||||
inline static size_t memory(Algorithm::Id algo)
|
||||
{
|
||||
switch (Algorithm::family(algo)) {
|
||||
case Algorithm::CN:
|
||||
return CN_MEMORY;
|
||||
Algorithm algorithm(algo);
|
||||
|
||||
case Algorithm::CN_LITE:
|
||||
return CN_MEMORY / 2;
|
||||
|
||||
case Algorithm::CN_HEAVY:
|
||||
return CN_MEMORY * 2;
|
||||
|
||||
case Algorithm::CN_PICO:
|
||||
return CN_MEMORY / 8;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return algorithm.isCN() ? algorithm.l3() : 0;
|
||||
}
|
||||
|
||||
inline static uint32_t iterations(Algorithm::Id algo)
|
||||
|
|
Loading…
Reference in a new issue