mirror of
https://github.com/xmrig/xmrig.git
synced 2026-02-01 17:53:03 -05:00
RandomX: added parameter for scratchpad prefetch mode
`scratchpad_prefetch_mode` can have 4 values: 0: off 1: use `prefetcht0` instruction (default, same as previous XMRig versions) 2: use `prefetchnta` instruction (faster on Coffee Lake and a few other CPUs) 3: use `mov` instruction
This commit is contained in:
@@ -57,6 +57,8 @@ static const char *kCacheQoS = "cache_qos";
|
||||
static const char *kNUMA = "numa";
|
||||
#endif
|
||||
|
||||
static const char *kScratchpadPrefetchMode = "scratchpad_prefetch_mode";
|
||||
|
||||
static const std::array<const char *, RxConfig::ModeMax> modeNames = { "auto", "fast", "light" };
|
||||
|
||||
|
||||
@@ -118,6 +120,11 @@ bool xmrig::RxConfig::read(const rapidjson::Value &value)
|
||||
}
|
||||
# endif
|
||||
|
||||
const int mode = Json::getInt(value, kScratchpadPrefetchMode, static_cast<int>(m_scratchpadPrefetchMode));
|
||||
if ((mode >= ScratchpadPrefetchOff) && (mode < ScratchpadPrefetchMax)) {
|
||||
m_scratchpadPrefetchMode = static_cast<ScratchpadPrefetchMode>(mode);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -171,6 +178,8 @@ rapidjson::Value xmrig::RxConfig::toJSON(rapidjson::Document &doc) const
|
||||
}
|
||||
# endif
|
||||
|
||||
obj.AddMember(StringRef(kScratchpadPrefetchMode), static_cast<int>(m_scratchpadPrefetchMode), allocator);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user