Merge pull request #1166 from SChernykh/dev

RandomX: fix for 272 initialization threads
This commit is contained in:
xmrig 2019-09-09 13:19:12 +07:00 committed by GitHub
commit 01b2c952ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,13 +72,13 @@ bool xmrig::RxDataset::init(const uint8_t *seed, uint32_t numThreads)
return true; return true;
} }
const uint32_t datasetItemCount = randomx_dataset_item_count(); const uint64_t datasetItemCount = randomx_dataset_item_count();
if (numThreads > 1) { if (numThreads > 1) {
std::vector<std::thread> threads; std::vector<std::thread> threads;
threads.reserve(numThreads); threads.reserve(numThreads);
for (uint32_t i = 0; i < numThreads; ++i) { for (uint64_t i = 0; i < numThreads; ++i) {
const uint32_t a = (datasetItemCount * i) / numThreads; const uint32_t a = (datasetItemCount * i) / numThreads;
const uint32_t b = (datasetItemCount * (i + 1)) / numThreads; const uint32_t b = (datasetItemCount * (i + 1)) / numThreads;
threads.emplace_back(randomx_init_dataset, m_dataset, m_cache->get(), a, b - a); threads.emplace_back(randomx_init_dataset, m_dataset, m_cache->get(), a, b - a);