Generate "rx" and "rx/wow" sections of CPU threads.
This commit is contained in:
parent
9b14caa9f9
commit
9bf4c2c98f
3 changed files with 22 additions and 6 deletions
|
@ -57,6 +57,11 @@ static const char *kCnHeavy = "cn-heavy";
|
||||||
static const char *kCnPico = "cn-pico";
|
static const char *kCnPico = "cn-pico";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
static const char *kRx = "rx";
|
||||||
|
static const char *kRxWOW = "rx/wow";
|
||||||
|
#endif
|
||||||
|
|
||||||
extern template class Threads<CpuThread>;
|
extern template class Threads<CpuThread>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -135,6 +140,11 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
|
||||||
# ifdef XMRIG_ALGO_CN_PICO
|
# ifdef XMRIG_ALGO_CN_PICO
|
||||||
m_threads.move(kCnPico, Cpu::info()->threads(Algorithm::CN_PICO_0));
|
m_threads.move(kCnPico, Cpu::info()->threads(Algorithm::CN_PICO_0));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
m_threads.move(kRx, Cpu::info()->threads(Algorithm::RX_0));
|
||||||
|
m_threads.move(kRxWOW, Cpu::info()->threads(Algorithm::RX_WOW));
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,11 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <libcpuid.h>
|
#include <libcpuid.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cpu/platform/AdvancedCpuInfo.h"
|
#include "backend/cpu/platform/AdvancedCpuInfo.h"
|
||||||
|
|
||||||
|
@ -144,6 +143,7 @@ xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm) co
|
||||||
if (cache) {
|
if (cache) {
|
||||||
cache *= 1024;
|
cache *= 1024;
|
||||||
const size_t memory = algorithm.memory();
|
const size_t memory = algorithm.memory();
|
||||||
|
assert(memory > 0);
|
||||||
|
|
||||||
count = cache / memory;
|
count = cache / memory;
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,10 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
|
||||||
|
|
||||||
size_t xmrig::Algorithm::memory() const
|
size_t xmrig::Algorithm::memory() const
|
||||||
{
|
{
|
||||||
if (family() < RANDOM_X) {
|
const Family f = family();
|
||||||
|
assert(f != UNKNOWN);
|
||||||
|
|
||||||
|
if (f < RANDOM_X) {
|
||||||
return CnAlgo<>::memory(m_id);
|
return CnAlgo<>::memory(m_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +141,7 @@ size_t xmrig::Algorithm::memory() const
|
||||||
return 0x100000;
|
return 0x100000;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0x200000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -181,12 +184,15 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
|
case RX_0:
|
||||||
case RX_WOW:
|
case RX_WOW:
|
||||||
|
case RX_LOKI:
|
||||||
return RANDOM_X;
|
return RANDOM_X;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
default:
|
case INVALID:
|
||||||
break;
|
case MAX:
|
||||||
|
return UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue