mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Fixed RandomX for CPUs without AES
This commit is contained in:
parent
7a6c7aac29
commit
187e55e28e
1 changed files with 5 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
||||||
#include "workers/CpuThread.h"
|
#include "workers/CpuThread.h"
|
||||||
#include "workers/MultiWorker.h"
|
#include "workers/MultiWorker.h"
|
||||||
#include "workers/Workers.h"
|
#include "workers/Workers.h"
|
||||||
|
#include "common/cpu/Cpu.h"
|
||||||
|
|
||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
|
@ -56,7 +57,10 @@ template<size_t N>
|
||||||
void MultiWorker<N>::allocateRandomX_VM()
|
void MultiWorker<N>::allocateRandomX_VM()
|
||||||
{
|
{
|
||||||
if (!m_rx_vm) {
|
if (!m_rx_vm) {
|
||||||
const int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_HARD_AES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT;
|
int flags = RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_FULL_MEM | RANDOMX_FLAG_JIT;
|
||||||
|
if (xmrig::Cpu::info()->hasAES())
|
||||||
|
flags |= RANDOMX_FLAG_HARD_AES;
|
||||||
|
|
||||||
m_rx_vm = randomx_create_vm(static_cast<randomx_flags>(flags), nullptr, Workers::getDataset());
|
m_rx_vm = randomx_create_vm(static_cast<randomx_flags>(flags), nullptr, Workers::getDataset());
|
||||||
if (!m_rx_vm) {
|
if (!m_rx_vm) {
|
||||||
m_rx_vm = randomx_create_vm(static_cast<randomx_flags>(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset());
|
m_rx_vm = randomx_create_vm(static_cast<randomx_flags>(flags - RANDOMX_FLAG_LARGE_PAGES), nullptr, Workers::getDataset());
|
||||||
|
|
Loading…
Reference in a new issue