Optimized RandomX initialization and switching.
This commit is contained in:
parent
ab0d3b8919
commit
84ff8af4bd
9 changed files with 156 additions and 157 deletions
|
@ -64,16 +64,8 @@ xmrig::RxDataset::~RxDataset()
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::RxDataset::init(const void *seed, const Algorithm &algorithm, uint32_t numThreads)
|
||||
bool xmrig::RxDataset::init(const void *seed, uint32_t numThreads)
|
||||
{
|
||||
if (isReady(seed, algorithm)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_algorithm != algorithm) {
|
||||
m_algorithm = RxAlgo::apply(algorithm);
|
||||
}
|
||||
|
||||
cache()->init(seed);
|
||||
|
||||
if (!get()) {
|
||||
|
@ -104,12 +96,6 @@ bool xmrig::RxDataset::init(const void *seed, const Algorithm &algorithm, uint32
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::RxDataset::isReady(const void *seed, const Algorithm &algorithm) const
|
||||
{
|
||||
return algorithm == m_algorithm && cache()->isReady(seed);
|
||||
}
|
||||
|
||||
|
||||
std::pair<size_t, size_t> xmrig::RxDataset::hugePages() const
|
||||
{
|
||||
constexpr size_t twoMiB = 2u * 1024u * 1024u;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue