From f0d52fcf4d89cb0d6ba90a28202b10506703a162 Mon Sep 17 00:00:00 2001 From: tevador Date: Fri, 15 Feb 2019 11:38:20 +0100 Subject: [PATCH] Fixed dependent constants --- src/common.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common.hpp b/src/common.hpp index 133f01b..5642535 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -37,13 +37,14 @@ namespace RandomX { constexpr int ArgonSaltSize = sizeof(ArgonSalt) - 1; constexpr int CacheLineSize = 64; - constexpr uint32_t CacheLineAlignMask = 0xFFFFFFFF & ~(CacheLineSize - 1); + constexpr uint64_t DatasetSize = 4ULL * 1024 * 1024 * 1024; //4 GiB + constexpr uint32_t CacheLineAlignMask = (DatasetSize - 1) & ~(CacheLineSize - 1); constexpr uint32_t CacheSize = ArgonMemorySize * 1024; constexpr int CacheBlockCount = CacheSize / CacheLineSize; - constexpr int BlockExpansionRatio = DatasetSize / CacheSize; - constexpr int DatasetBlockCount = BlockExpansionRatio * CacheBlockCount; - constexpr int DatasetIterations = 16; + constexpr int DatasetExpansionRatio = DatasetSize / CacheSize; + constexpr int DatasetBlockCount = DatasetExpansionRatio * CacheBlockCount; + constexpr int DatasetIterations = DatasetExpansionRatio; #ifdef TRACE