From 1c3666aa985e6e276bffcee907cb5fbf138889a9 Mon Sep 17 00:00:00 2001 From: tevador Date: Tue, 23 Apr 2019 22:27:23 +0200 Subject: [PATCH] Fixed benchmark code --- src/tests/benchmark.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tests/benchmark.cpp b/src/tests/benchmark.cpp index 6181eb5..34f5c47 100644 --- a/src/tests/benchmark.cpp +++ b/src/tests/benchmark.cpp @@ -180,9 +180,10 @@ int main(int argc, char** argv) { std::cout << "ERROR: Dataset allocation failed" << std::endl; return 1; } + uint32_t datasetItemCount = randomx_dataset_item_count(); if (initThreadCount > 1) { - auto perThread = RANDOMX_DATASET_ITEMS / initThreadCount; - auto remainder = RANDOMX_DATASET_ITEMS % initThreadCount; + auto perThread = datasetItemCount / initThreadCount; + auto remainder = datasetItemCount % initThreadCount; uint32_t startItem = 0; for (int i = 0; i < initThreadCount; ++i) { auto count = perThread + (i == initThreadCount - 1 ? remainder : 0); @@ -194,7 +195,7 @@ int main(int argc, char** argv) { } } else { - randomx_init_dataset(dataset, cache, 0, RANDOMX_DATASET_ITEMS); + randomx_init_dataset(dataset, cache, 0, datasetItemCount); } randomx_release_cache(cache); threads.clear();