diff --git a/src/backend/opencl/OclLaunchData.cpp b/src/backend/opencl/OclLaunchData.cpp index 149ba075b..70465a566 100644 --- a/src/backend/opencl/OclLaunchData.cpp +++ b/src/backend/opencl/OclLaunchData.cpp @@ -25,9 +25,9 @@ #include "backend/opencl/OclLaunchData.h" - #include "backend/common/Tags.h" #include "backend/opencl/OclConfig.h" +#include "crypto/rx/RxAlgo.h" xmrig::OclLaunchData::OclLaunchData(const Miner *miner, const Algorithm &algorithm, const OclConfig &config, const OclPlatform &platform, const OclThread &thread, const OclDevice &device, int64_t affinity) : @@ -44,8 +44,8 @@ xmrig::OclLaunchData::OclLaunchData(const Miner *miner, const Algorithm &algorit bool xmrig::OclLaunchData::isEqual(const OclLaunchData &other) const { - return (other.algorithm == algorithm && - other.thread == thread); + return (RxAlgo::id(other.algorithm) == RxAlgo::id(algorithm) && + other.thread == thread); } diff --git a/src/backend/opencl/cl/cn/algorithm.cl b/src/backend/opencl/cl/cn/algorithm.cl index a1bed3cc4..4f33a6805 100644 --- a/src/backend/opencl/cl/cn/algorithm.cl +++ b/src/backend/opencl/cl/cn/algorithm.cl @@ -21,8 +21,9 @@ #define ALGO_RX_LOKI 20 #define ALGO_RX_ARQMA 21 #define ALGO_RX_SFX 22 -#define ALGO_AR2_CHUKWA 23 -#define ALGO_AR2_WRKZ 24 +#define ALGO_RX_V 23 +#define ALGO_AR2_CHUKWA 24 +#define ALGO_AR2_WRKZ 25 #define FAMILY_UNKNOWN 0 #define FAMILY_CN 1 diff --git a/src/backend/opencl/runners/OclRxBaseRunner.cpp b/src/backend/opencl/runners/OclRxBaseRunner.cpp index 8eb390e68..36a31e1b7 100644 --- a/src/backend/opencl/runners/OclRxBaseRunner.cpp +++ b/src/backend/opencl/runners/OclRxBaseRunner.cpp @@ -56,10 +56,7 @@ xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data) m_gcn_version = 14; } - // rx/sfx is the same as rx/0 except Argon salt for dataset generation - Algorithm::Id id = (m_algorithm.id() == Algorithm::RX_SFX) ? Algorithm::RX_0 : m_algorithm.id(); - - m_options += " -DALGO=" + std::to_string(id); + m_options += " -DALGO=" + std::to_string(RxAlgo::id(m_algorithm)); m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize); m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version); } diff --git a/src/crypto/common/Algorithm.cpp b/src/crypto/common/Algorithm.cpp index 99883daa7..f7c988166 100644 --- a/src/crypto/common/Algorithm.cpp +++ b/src/crypto/common/Algorithm.cpp @@ -114,6 +114,7 @@ static AlgoName const algorithm_names[] = { { "RandomARQ", nullptr, Algorithm::RX_ARQ }, { "randomx/sfx", "rx/sfx", Algorithm::RX_SFX }, { "RandomSFX", nullptr, Algorithm::RX_SFX }, + { "RandomV", "rx/v", Algorithm::RX_V }, # endif # ifdef XMRIG_ALGO_ARGON2 { "argon2/chukwa", nullptr, Algorithm::AR2_CHUKWA }, @@ -141,6 +142,7 @@ size_t xmrig::Algorithm::l2() const case RX_0: case RX_LOKI: case RX_SFX: + case RX_V: return 0x40000; case RX_WOW: @@ -177,6 +179,7 @@ size_t xmrig::Algorithm::l3() const case RX_0: case RX_LOKI: case RX_SFX: + case RX_V: return oneMiB * 2; case RX_WOW: @@ -277,6 +280,7 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id) case RX_LOKI: case RX_ARQ: case RX_SFX: + case RX_V: return RANDOM_X; # endif diff --git a/src/crypto/common/Algorithm.h b/src/crypto/common/Algorithm.h index bfdcea5a2..c72b4e6aa 100644 --- a/src/crypto/common/Algorithm.h +++ b/src/crypto/common/Algorithm.h @@ -68,6 +68,7 @@ public: RX_LOKI, // "rx/loki" RandomXL (Loki). RX_ARQ, // "rx/arq" RandomARQ (Arqma). RX_SFX, // "rx/sfx" RandomSFX (Safex Cash). + RX_V, // "rx/v" RandomV (Monerov). AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa). AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ) MAX diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index dfbda9684..c6d6ff38f 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -97,6 +97,11 @@ RandomX_ConfigurationSafex::RandomX_ConfigurationSafex() ArgonSalt = "RandomSFX\x01"; } +RandomX_ConfigurationV::RandomX_ConfigurationV() +{ + ArgonSalt = "RandomV\x03"; +} + RandomX_ConfigurationBase::RandomX_ConfigurationBase() : ArgonMemory(262144) , ArgonIterations(3) @@ -273,6 +278,7 @@ RandomX_ConfigurationWownero RandomX_WowneroConfig; RandomX_ConfigurationLoki RandomX_LokiConfig; RandomX_ConfigurationArqma RandomX_ArqmaConfig; RandomX_ConfigurationSafex RandomX_SafexConfig; +RandomX_ConfigurationV RandomX_VConfig; RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/randomx/randomx.h b/src/crypto/randomx/randomx.h index 793e6e1b2..90203a441 100644 --- a/src/crypto/randomx/randomx.h +++ b/src/crypto/randomx/randomx.h @@ -183,12 +183,14 @@ struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX struct RandomX_ConfigurationLoki : public RandomX_ConfigurationBase { RandomX_ConfigurationLoki(); }; struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); }; struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); }; +struct RandomX_ConfigurationV : public RandomX_ConfigurationBase { RandomX_ConfigurationV(); }; extern RandomX_ConfigurationMonero RandomX_MoneroConfig; extern RandomX_ConfigurationWownero RandomX_WowneroConfig; extern RandomX_ConfigurationLoki RandomX_LokiConfig; extern RandomX_ConfigurationArqma RandomX_ArqmaConfig; extern RandomX_ConfigurationSafex RandomX_SafexConfig; +extern RandomX_ConfigurationV RandomX_VConfig; extern RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/rx/RxAlgo.cpp b/src/crypto/rx/RxAlgo.cpp index 4630303e7..b08b3b8e2 100644 --- a/src/crypto/rx/RxAlgo.cpp +++ b/src/crypto/rx/RxAlgo.cpp @@ -37,6 +37,16 @@ xmrig::Algorithm::Id xmrig::RxAlgo::apply(Algorithm::Id algorithm) } +xmrig::Algorithm::Id xmrig::RxAlgo::id(Algorithm::Id algorithm) +{ + if (algorithm == Algorithm::RX_SFX || algorithm == Algorithm::RX_V) { + return Algorithm::RX_0; + } + + return algorithm; +} + + const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm) { switch (algorithm) { @@ -52,6 +62,9 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm) case Algorithm::RX_SFX: return &RandomX_SafexConfig; + case Algorithm::RX_V: + return &RandomX_VConfig; + default: break; } diff --git a/src/crypto/rx/RxAlgo.h b/src/crypto/rx/RxAlgo.h index 00c44ece7..ff2750c62 100644 --- a/src/crypto/rx/RxAlgo.h +++ b/src/crypto/rx/RxAlgo.h @@ -46,6 +46,7 @@ class RxAlgo { public: static Algorithm::Id apply(Algorithm::Id algorithm); + static Algorithm::Id id(Algorithm::Id algorithm); static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm); static uint32_t programCount(Algorithm::Id algorithm); static uint32_t programIterations(Algorithm::Id algorithm);