From aab5b7f55e96571b4a3248c67ee687ef26f25700 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 10 Jun 2020 20:31:56 -0700 Subject: [PATCH] Enabled RYO --- CMakeLists.txt | 2 +- src/backend/opencl/runners/OclRyoRunner.h | 59 ++++++++++++----------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c355ba6..30b05651 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ option(WITH_HWLOC "Enable hwloc support" ON) option(WITH_CN_LITE "Enable CryptoNight-Lite algorithms family" ON) option(WITH_CN_HEAVY "Enable CryptoNight-Heavy algorithms family" ON) option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON) -option(WITH_CN_GPU "Enable CryptoNight-GPU algorithm" OFF) +option(WITH_CN_GPU "Enable CryptoNight-GPU algorithm" ON) option(WITH_RANDOMX "Enable RandomX algorithms family" ON) option(WITH_ARGON2 "Enable Argon2 algorithms family" ON) option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON) diff --git a/src/backend/opencl/runners/OclRyoRunner.h b/src/backend/opencl/runners/OclRyoRunner.h index c09f3ae8..4cf6245f 100644 --- a/src/backend/opencl/runners/OclRyoRunner.h +++ b/src/backend/opencl/runners/OclRyoRunner.h @@ -1,4 +1,10 @@ /* XMRig + * Copyright 2010 Jeff Garzik + * Copyright 2012-2014 pooler + * Copyright 2014 Lucas Jones + * Copyright 2014-2016 Wolf9466 + * Copyright 2016 Jay D Dee + * Copyright 2017-2018 XMR-Stak , * Copyright 2018-2020 SChernykh * Copyright 2016-2020 XMRig , * @@ -16,50 +22,49 @@ * along with this program. If not, see . */ -#ifndef XMRIG_ETHSTRATUMCLIENT_H -#define XMRIG_ETHSTRATUMCLIENT_H +#ifndef XMRIG_OCLRYORUNNER_H +#define XMRIG_OCLRYORUNNER_H -#include "base/net/stratum/Client.h" - - -#include +#include "backend/opencl/runners/OclBaseRunner.h" namespace xmrig { -class EthStratumClient : public Client +class Cn00RyoKernel; +class Cn0Kernel; +class Cn1RyoKernel; +class Cn2RyoKernel; + + +class OclRyoRunner : public OclBaseRunner { public: - XMRIG_DISABLE_COPY_MOVE_DEFAULT(EthStratumClient) + XMRIG_DISABLE_COPY_MOVE_DEFAULT(OclRyoRunner) - EthStratumClient(int id, const char *agent, IClientListener *listener); - ~EthStratumClient() override = default; + OclRyoRunner(size_t index, const OclLaunchData &data); + + ~OclRyoRunner() override; protected: - int64_t submit(const JobResult &result) override; - void login() override; - void onClose() override; - - bool handleResponse(int64_t id, const rapidjson::Value &result, const rapidjson::Value &error) override; - void parseNotification(const char *method, const rapidjson::Value ¶ms, const rapidjson::Value &error) override; - - void setExtraNonce(const rapidjson::Value &nonce); + size_t bufferSize() const override; + void run(uint32_t nonce, uint32_t *hashOutput) override; + void set(const Job &job, uint8_t *blob) override; + void build() override; + void init() override; private: - const char *errorMessage(const rapidjson::Value &error) const; - void authorize(); - void onAuthorizeResponse(const rapidjson::Value &result, bool success, uint64_t elapsed); - void onSubscribeResponse(const rapidjson::Value &result, bool success, uint64_t elapsed); - void subscribe(); - - bool m_authorized = false; - std::pair m_extraNonce{}; + cl_mem m_scratchpads = nullptr; + cl_mem m_states = nullptr; + Cn00RyoKernel *m_cn00 = nullptr; + Cn0Kernel *m_cn0 = nullptr; + Cn1RyoKernel *m_cn1 = nullptr; + Cn2RyoKernel *m_cn2 = nullptr; }; } /* namespace xmrig */ -#endif /* XMRIG_ETHSTRATUMCLIENT_H */ +#endif // XMRIG_OCLRYORUNNER_H