Update CN-GPU integration

This commit is contained in:
Tony Butler 2021-08-20 03:09:03 -06:00
parent 0e5b54b80a
commit be26d56f66
19 changed files with 144 additions and 142 deletions

View file

@ -5,8 +5,8 @@ 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" ON)
option(WITH_CN_FEMTO "Enable CryptoNight-UPX2 algorithm" ON)
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)
@ -206,6 +206,7 @@ add_definitions(-D__STDC_FORMAT_MACROS -DUNICODE -D_FILE_OFFSET_BITS=64)
find_package(UV REQUIRED)
include(cmake/flags.cmake)
include(cmake/cn-gpu.cmake)
include(cmake/randomx.cmake)
include(cmake/argon2.cmake)
include(cmake/astrobwt.cmake)
@ -213,7 +214,6 @@ include(cmake/kawpow.cmake)
include(cmake/ghostrider.cmake)
include(cmake/OpenSSL.cmake)
include(cmake/asm.cmake)
include(cmake/cn-gpu.cmake)
if (WITH_CN_LITE)
add_definitions(/DXMRIG_ALGO_CN_LITE)

View file

@ -48,16 +48,16 @@ size_t inline generate<Algorithm::CN>(Threads<CpuThreads> &threads, uint32_t lim
size_t count = 0;
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, limit);
count += generate(Algorithm::kCN_2, threads, Algorithm::CN_2, limit);
# ifdef XMRIG_ALGO_CN_GPU
count += generate(Algorithm::kCN_GPU, threads, Algorithm::CN_GPU, limit);
# endif
if (!threads.isExist(Algorithm::CN_0)) {
threads.disable(Algorithm::CN_0);
++count;
}
# ifdef XMRIG_ALGO_CN_GPU
count += generate(Algorithm::kCN_GPU, threads, Algorithm::CN_GPU, limit);
# endif
return count;
}

View file

@ -181,20 +181,19 @@ bool xmrig::CpuWorker<N>::selfTest()
verify(Algorithm::CN_RWZ, test_output_rwz) &&
verify(Algorithm::CN_ZLS, test_output_zls) &&
verify(Algorithm::CN_CCX, test_output_ccx) &&
verify(Algorithm::CN_DOUBLE, test_output_double)
# ifdef XMRIG_ALGO_CN_GPU
verify(Algorithm::CN_GPU, test_output_gpu) &&
&&
verify(Algorithm::CN_GPU, test_output_gpu)
# endif
verify(Algorithm::CN_DOUBLE, test_output_double);
;
# ifdef XMRIG_ALGO_CN_GPU
if (!rc || N > 1) {
return rc;
}
if (! (!rc || N > 1)) {
return verify(Algorithm::CN_GPU, test_output_gpu);
# else
return rc;
} else
# endif
return rc;
}
# ifdef XMRIG_ALGO_CN_LITE

View file

@ -340,6 +340,12 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return count_limit;
}
# endif
# ifdef XMRIG_ALGO_RANDOMX
if (f == Algorithm::RANDOM_X) {
if (algorithm == Algorithm::RX_WOW) {
@ -374,12 +380,6 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return count_limit;
}
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
if (f == Algorithm::GHOSTRIDER) {
return CpuThreads(std::max<size_t>(count / 2, 1), 8);

View file

@ -52,16 +52,15 @@ size_t inline generate<Algorithm::CN>(Threads<CudaThreads> &threads, const std::
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, devices);
count += generate(Algorithm::kCN_2, threads, Algorithm::CN_2, devices);
# ifdef XMRIG_ALGO_CN_GPU
count += generate(Algorithm::kCN_GPU, threads, Algorithm::CN_GPU, devices);
# endif
if (!threads.isExist(Algorithm::CN_0)) {
threads.disable(Algorithm::CN_0);
count++;
}
# ifdef XMRIG_ALGO_CN_GPU
count += generate("cn/gpu", threads, Algorithm::CN_GPU, devices);
# endif
return count;
}

View file

@ -51,16 +51,15 @@ size_t inline generate<Algorithm::CN>(Threads<OclThreads> &threads, const std::v
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, devices);
count += generate(Algorithm::kCN_2, threads, Algorithm::CN_2, devices);
# ifdef XMRIG_ALGO_CN_GPU
count += generate(Algorithm::kCN_GPU, threads, Algorithm::CN_GPU, devices);
# endif
if (!threads.isExist(Algorithm::CN_0)) {
threads.disable(Algorithm::CN_0);
count++;
}
# ifdef XMRIG_ALGO_CN_GPU
count += generate("cn/gpu", threads, Algorithm::CN_GPU, devices);
# endif
return count;
}

View file

@ -45,6 +45,20 @@ public:
setIntensity(intensity);
}
# ifdef XMRIG_ALGO_CN_GPU
OclThread(uint32_t index, uint32_t intensity, uint32_t worksize, uint32_t threads, uint32_t unrollFactor) :
m_fields(0),
m_threads(threads, -1),
m_index(index),
m_memChunk(0),
m_stridedIndex(0),
m_unrollFactor(unrollFactor),
m_worksize(worksize)
{
setIntensity(intensity);
}
# endif
# ifdef XMRIG_ALGO_RANDOMX
OclThread(uint32_t index, uint32_t intensity, uint32_t worksize, uint32_t threads, bool gcnAsm, bool datasetHost, uint32_t bfactor) :
m_datasetHost(datasetHost),
@ -89,20 +103,6 @@ public:
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
OclThread(uint32_t index, uint32_t intensity, uint32_t worksize, uint32_t threads, uint32_t unrollFactor) :
m_fields(0),
m_threads(threads, -1),
m_index(index),
m_memChunk(0),
m_stridedIndex(0),
m_unrollFactor(unrollFactor),
m_worksize(worksize)
{
setIntensity(intensity);
}
# endif
OclThread(const rapidjson::Value &value);
inline bool isAsm() const { return m_gcnAsm; }

View file

@ -29,6 +29,10 @@
#include "net/JobResults.h"
#ifdef XMRIG_ALGO_CN_GPU
# include "backend/opencl/runners/OclRyoRunner.h"
#endif
#ifdef XMRIG_ALGO_RANDOMX
# include "backend/opencl/runners/OclRxJitRunner.h"
# include "backend/opencl/runners/OclRxVmRunner.h"
@ -42,10 +46,6 @@
# include "backend/opencl/runners/OclKawPowRunner.h"
#endif
#ifdef XMRIG_ALGO_CN_GPU
# include "backend/opencl/runners/OclRyoRunner.h"
#endif
#include <cassert>
#include <thread>

View file

@ -28,6 +28,10 @@
#include "base/crypto/Algorithm.h"
#ifdef XMRIG_ALGO_CN_GPU
# include "backend/opencl/cl/cn/cryptonight_gpu_cl.h"
#endif
#ifdef XMRIG_ALGO_RANDOMX
# include "backend/opencl/cl/rx/randomx_cl.h"
#endif
@ -41,13 +45,15 @@
# include "backend/opencl/cl/kawpow/kawpow_dag_cl.h"
#endif
#ifdef XMRIG_ALGO_CN_GPU
# include "backend/opencl/cl/cn/cryptonight_gpu_cl.h"
#endif
const char *xmrig::OclSource::get(const Algorithm &algorithm)
{
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return cryptonight_gpu_cl;
}
# endif
# ifdef XMRIG_ALGO_RANDOMX
if (algorithm.family() == Algorithm::RANDOM_X) {
return randomx_cl;
@ -66,11 +72,5 @@ const char *xmrig::OclSource::get(const Algorithm &algorithm)
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return cryptonight_gpu_cl;
}
# endif
return cryptonight_cl;
}

View file

@ -18,6 +18,7 @@
#define ALGO_CN_PICO_0 0x63120200
#define ALGO_CN_PICO_TLO 0x63120274
#define ALGO_CN_UPX2 0x63110200
#define ALGO_CN_GPU 0x63150300
#define ALGO_RX_0 0x72151200
#define ALGO_RX_WOW 0x72141177
#define ALGO_RX_ARQMA 0x72121061
@ -30,7 +31,6 @@
#define ALGO_ASTROBWT_DERO 0x41000000
#define ALGO_KAWPOW_RVN 0x6b0f0000
#define ALGO_CN_GPU 0x631500ff
#define ALGO_RX_XLA 0x721211ff
#define FAMILY_UNKNOWN 0

View file

@ -30,19 +30,19 @@ static const char cryptonight_cl[61582] = {
0x30,0x36,0x38,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x50,0x49,0x43,0x4f,0x5f,0x30,0x20,0x30,0x78,0x36,0x33,0x31,
0x32,0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x50,0x49,0x43,0x4f,0x5f,0x54,0x4c,0x4f,0x20,0x30,
0x78,0x36,0x33,0x31,0x32,0x30,0x32,0x37,0x34,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x55,0x50,0x58,0x32,0x20,0x30,
0x78,0x36,0x33,0x31,0x31,0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x30,0x20,0x30,0x78,0x37,0x32,
0x31,0x35,0x31,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x57,0x4f,0x57,0x20,0x30,0x78,0x37,0x32,0x31,
0x34,0x31,0x31,0x37,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x41,0x52,0x51,0x4d,0x41,0x20,0x30,0x78,0x37,0x32,
0x31,0x32,0x31,0x30,0x36,0x31,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x53,0x46,0x58,0x20,0x30,0x78,0x37,0x32,0x31,
0x35,0x31,0x32,0x37,0x33,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x4b,0x45,0x56,0x41,0x20,0x30,0x78,0x37,0x32,0x31,
0x34,0x31,0x31,0x36,0x62,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x47,0x52,0x41,0x46,0x54,0x20,0x30,0x78,0x37,0x32,
0x31,0x35,0x31,0x32,0x36,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,0x20,0x30,
0x78,0x36,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,
0x41,0x5f,0x56,0x32,0x20,0x30,0x78,0x36,0x31,0x31,0x34,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,
0x5f,0x57,0x52,0x4b,0x5a,0x20,0x30,0x78,0x36,0x31,0x31,0x32,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x53,
0x54,0x52,0x4f,0x42,0x57,0x54,0x5f,0x44,0x45,0x52,0x4f,0x20,0x30,0x78,0x34,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,
0x4c,0x47,0x4f,0x5f,0x4b,0x41,0x57,0x50,0x4f,0x57,0x5f,0x52,0x56,0x4e,0x20,0x30,0x78,0x36,0x62,0x30,0x66,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,
0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x47,0x50,0x55,0x20,0x30,0x78,0x36,0x33,0x31,0x35,0x30,0x30,0x66,0x66,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
0x78,0x36,0x33,0x31,0x31,0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x47,0x50,0x55,0x20,0x30,0x78,
0x36,0x33,0x31,0x35,0x30,0x33,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x30,0x20,0x30,0x78,0x37,0x32,0x31,
0x35,0x31,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x57,0x4f,0x57,0x20,0x30,0x78,0x37,0x32,0x31,0x34,
0x31,0x31,0x37,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x41,0x52,0x51,0x4d,0x41,0x20,0x30,0x78,0x37,0x32,0x31,
0x32,0x31,0x30,0x36,0x31,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x53,0x46,0x58,0x20,0x30,0x78,0x37,0x32,0x31,0x35,
0x31,0x32,0x37,0x33,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x4b,0x45,0x56,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x34,
0x31,0x31,0x36,0x62,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x47,0x52,0x41,0x46,0x54,0x20,0x30,0x78,0x37,0x32,0x31,
0x35,0x31,0x32,0x36,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,0x20,0x30,0x78,
0x36,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,
0x5f,0x56,0x32,0x20,0x30,0x78,0x36,0x31,0x31,0x34,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,
0x57,0x52,0x4b,0x5a,0x20,0x30,0x78,0x36,0x31,0x31,0x32,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x53,0x54,
0x52,0x4f,0x42,0x57,0x54,0x5f,0x44,0x45,0x52,0x4f,0x20,0x30,0x78,0x34,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,
0x47,0x4f,0x5f,0x4b,0x41,0x57,0x50,0x4f,0x57,0x5f,0x52,0x56,0x4e,0x20,0x30,0x78,0x36,0x62,0x30,0x66,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x58,0x4c,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x32,0x31,0x31,0x66,0x66,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,
0x46,0x41,0x4d,0x49,0x4c,0x59,0x5f,0x55,0x4e,0x4b,0x4e,0x4f,0x57,0x4e,0x20,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x46,0x41,0x4d,0x49,0x4c,0x59,0x5f,
0x43,0x4e,0x20,0x30,0x78,0x36,0x33,0x31,0x35,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x46,0x41,0x4d,0x49,0x4c,0x59,0x5f,0x43,0x4e,0x5f,

View file

@ -23,19 +23,19 @@ static const char randomx_cl[131086] = {
0x36,0x38,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x50,0x49,0x43,0x4f,0x5f,0x30,0x20,0x30,0x78,0x36,0x33,0x31,0x32,
0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x50,0x49,0x43,0x4f,0x5f,0x54,0x4c,0x4f,0x20,0x30,0x78,
0x36,0x33,0x31,0x32,0x30,0x32,0x37,0x34,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x55,0x50,0x58,0x32,0x20,0x30,0x78,
0x36,0x33,0x31,0x31,0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x30,0x20,0x30,0x78,0x37,0x32,0x31,
0x35,0x31,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x57,0x4f,0x57,0x20,0x30,0x78,0x37,0x32,0x31,0x34,
0x31,0x31,0x37,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x41,0x52,0x51,0x4d,0x41,0x20,0x30,0x78,0x37,0x32,0x31,
0x32,0x31,0x30,0x36,0x31,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x53,0x46,0x58,0x20,0x30,0x78,0x37,0x32,0x31,0x35,
0x31,0x32,0x37,0x33,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x4b,0x45,0x56,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x34,
0x31,0x31,0x36,0x62,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x47,0x52,0x41,0x46,0x54,0x20,0x30,0x78,0x37,0x32,0x31,
0x35,0x31,0x32,0x36,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,0x20,0x30,0x78,
0x36,0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,
0x5f,0x56,0x32,0x20,0x30,0x78,0x36,0x31,0x31,0x34,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,
0x57,0x52,0x4b,0x5a,0x20,0x30,0x78,0x36,0x31,0x31,0x32,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x53,0x54,
0x52,0x4f,0x42,0x57,0x54,0x5f,0x44,0x45,0x52,0x4f,0x20,0x30,0x78,0x34,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,
0x47,0x4f,0x5f,0x4b,0x41,0x57,0x50,0x4f,0x57,0x5f,0x52,0x56,0x4e,0x20,0x30,0x78,0x36,0x62,0x30,0x66,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x47,0x50,0x55,0x20,0x30,0x78,0x36,0x33,0x31,0x35,0x30,0x30,0x66,0x66,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,
0x36,0x33,0x31,0x31,0x30,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x47,0x50,0x55,0x20,0x30,0x78,0x36,
0x33,0x31,0x35,0x30,0x33,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x30,0x20,0x30,0x78,0x37,0x32,0x31,0x35,
0x31,0x32,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x57,0x4f,0x57,0x20,0x30,0x78,0x37,0x32,0x31,0x34,0x31,
0x31,0x37,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x41,0x52,0x51,0x4d,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x32,
0x31,0x30,0x36,0x31,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x53,0x46,0x58,0x20,0x30,0x78,0x37,0x32,0x31,0x35,0x31,
0x32,0x37,0x33,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x4b,0x45,0x56,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x34,0x31,
0x31,0x36,0x62,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x47,0x52,0x41,0x46,0x54,0x20,0x30,0x78,0x37,0x32,0x31,0x35,
0x31,0x32,0x36,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,0x20,0x30,0x78,0x36,
0x31,0x31,0x33,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x43,0x48,0x55,0x4b,0x57,0x41,0x5f,
0x56,0x32,0x20,0x30,0x78,0x36,0x31,0x31,0x34,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x52,0x32,0x5f,0x57,
0x52,0x4b,0x5a,0x20,0x30,0x78,0x36,0x31,0x31,0x32,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x41,0x53,0x54,0x52,
0x4f,0x42,0x57,0x54,0x5f,0x44,0x45,0x52,0x4f,0x20,0x30,0x78,0x34,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,
0x4f,0x5f,0x4b,0x41,0x57,0x50,0x4f,0x57,0x5f,0x52,0x56,0x4e,0x20,0x30,0x78,0x36,0x62,0x30,0x66,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,
0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x58,0x4c,0x41,0x20,0x30,0x78,0x37,0x32,0x31,0x32,0x31,0x31,0x66,0x66,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x46,
0x41,0x4d,0x49,0x4c,0x59,0x5f,0x55,0x4e,0x4b,0x4e,0x4f,0x57,0x4e,0x20,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x46,0x41,0x4d,0x49,0x4c,0x59,0x5f,0x43,
0x4e,0x20,0x30,0x78,0x36,0x33,0x31,0x35,0x30,0x30,0x30,0x30,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x46,0x41,0x4d,0x49,0x4c,0x59,0x5f,0x43,0x4e,0x5f,0x4c,

View file

@ -74,6 +74,10 @@ const char *Algorithm::kCN_PICO_TLO = "cn-pico/tlo";
const char *Algorithm::kCN_UPX2 = "cn/upx2";
#endif
#ifdef XMRIG_ALGO_CN_GPU
const char *Algorithm::kCN_GPU = "cn/gpu";
#endif
#ifdef XMRIG_ALGO_RANDOMX
const char *Algorithm::kRX = "rx";
const char *Algorithm::kRX_0 = "rx/0";
@ -106,10 +110,6 @@ const char* Algorithm::kGHOSTRIDER = "ghostrider";
const char* Algorithm::kGHOSTRIDER_RTM = "ghostrider";
#endif
#ifdef XMRIG_ALGO_CN_GPU
const char *Algorithm::kCN_GPU = "cn/gpu";
#endif
#ifdef XMRIG_ALGO_RANDOMX
const char *Algorithm::kRX_XLA = "panthera";
#endif
@ -154,6 +154,10 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
ALGO_NAME(CN_UPX2),
# endif
# ifdef XMRIG_ALGO_CN_GPU
ALGO_NAME(CN_GPU),
# endif
# ifdef XMRIG_ALGO_RANDOMX
ALGO_NAME(RX_0),
ALGO_NAME(RX_WOW),
@ -177,10 +181,6 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
ALGO_NAME(KAWPOW_RVN),
# endif
# ifdef XMRIG_ALGO_CN_GPU
ALGO_NAME(CN_GPU),
# endif
# ifdef XMRIG_ALGO_RANDOMX
ALGO_NAME(RX_XLA),
# endif
@ -272,6 +272,11 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
ALGO_ALIAS(CN_UPX2, "cryptonight-upx/2"),
# endif
# ifdef XMRIG_ALGO_CN_GPU
ALGO_ALIAS_AUTO(CN_GPU), ALGO_ALIAS(CN_GPU, "cryptonight/gpu"),
ALGO_ALIAS(CN_GPU, "cryptonight_gpu"),
# endif
# ifdef XMRIG_ALGO_RANDOMX
ALGO_ALIAS_AUTO(RX_0), ALGO_ALIAS(RX_0, "randomx/0"),
ALGO_ALIAS(RX_0, "randomx/test"),
@ -304,10 +309,6 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
ALGO_ALIAS_AUTO(KAWPOW_RVN), ALGO_ALIAS(KAWPOW_RVN, "kawpow/rvn"),
# endif
# ifdef XMRIG_ALGO_CN_GPU
ALGO_ALIAS_AUTO(CN_GPU), ALGO_ALIAS(CN_GPU, "cryptonight/gpu"),
# endif
# ifdef XMRIG_ALGO_RANDOMX
ALGO_ALIAS_AUTO(RX_XLA), ALGO_ALIAS(RX_XLA, "Panthera"),
# endif
@ -387,8 +388,9 @@ std::vector<xmrig::Algorithm> xmrig::Algorithm::all(const std::function<bool(con
CN_HEAVY_0, CN_HEAVY_TUBE, CN_HEAVY_XHV,
CN_PICO_0, CN_PICO_TLO,
CN_UPX2,
CN_GPU, RX_XLA,
CN_GPU,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA,
RX_XLA,
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
ASTROBWT_DERO,
KAWPOW_RVN,

View file

@ -65,6 +65,7 @@ public:
CN_PICO_0 = 0x63120200, // "cn-pico" CryptoNight-Pico
CN_PICO_TLO = 0x63120274, // "cn-pico/tlo" CryptoNight-Pico (TLO)
CN_UPX2 = 0x63110200, // "cn/upx2" Uplexa (UPX2)
CN_GPU = 0x63150300, // "cn/gpu" CryptoNight-GPU (Ryo).
CN_GR_0 = 0x63130100, // "cn/dark" GhostRider
CN_GR_1 = 0x63130101, // "cn/dark-lite" GhostRider
CN_GR_2 = 0x63150102, // "cn/fast" GhostRider
@ -84,7 +85,6 @@ public:
ASTROBWT_DERO = 0x41000000, // "astrobwt" AstroBWT (Dero)
KAWPOW_RVN = 0x6b0f0000, // "kawpow/rvn" KawPow (RVN)
CN_GPU = 0x631500ff, // "cn/gpu" CryptoNight-GPU (Ryo).
RX_XLA = 0x721211ff, // "panthera" Panthera (Scala2).
};
@ -141,6 +141,10 @@ public:
static const char *kCN_UPX2;
# endif
# ifdef XMRIG_ALGO_CN_GPU
static const char *kCN_GPU;
# endif
# ifdef XMRIG_ALGO_RANDOMX
static const char *kRX;
static const char *kRX_0;
@ -168,10 +172,6 @@ public:
static const char *kKAWPOW_RVN;
# endif
# ifdef XMRIG_ALGO_CN_GPU
static const char *kCN_GPU;
# endif
# ifdef XMRIG_ALGO_RANDOMX
static const char *kRX_XLA;
# endif

View file

@ -83,16 +83,16 @@ public:
return CN_ITER / 8;
# endif
# ifdef XMRIG_ALGO_CN_GPU
case Algorithm::CN_GPU:
return 0xC000;
# endif
# ifdef XMRIG_ALGO_CN_FEMTO
case Algorithm::CN_UPX2:
return CN_ITER / 32;
# endif
# ifdef XMRIG_ALGO_CN_GPU
case Algorithm::CN_GPU:
return 0xC000;
# endif
default:
break;
}
@ -108,18 +108,18 @@ public:
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
if (algo == Algorithm::CN_GPU) {
return 0x1FFFC0;
}
# endif
# ifdef XMRIG_ALGO_CN_FEMTO
if (algo == Algorithm::CN_UPX2) {
return 0x1FFF0;
}
# endif
# ifdef XMRIG_ALGO_CN_GPU
if (algo == Algorithm::CN_GPU) {
return 0x1FFFC0;
}
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
if (algo == Algorithm::CN_GR_1) {
return 0x3FFF0;
@ -152,13 +152,13 @@ template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_ZLS>::iterations() con
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_PICO_0>::iterations() const { return CN_ITER / 8; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_PICO_TLO>::iterations() const { return CN_ITER / 8; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_CCX>::iterations() const { return CN_ITER / 2; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GPU>::iterations() const { return 0xC000; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_UPX2>::iterations() const { return CN_ITER / 32; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GPU>::iterations() const { return 0xC000; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_PICO_0>::mask() const { return 0x1FFF0; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GPU>::mask() const { return 0x1FFFC0; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_UPX2>::mask() const { return 0x1FFF0; }
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GPU>::mask() const { return 0x1FFFC0; }
#ifdef XMRIG_ALGO_GHOSTRIDER
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_0>::iterations() const { return CN_ITER / 4; }

View file

@ -290,6 +290,12 @@ xmrig::CnHash::CnHash()
ADD_FN_ASM(Algorithm::CN_UPX2);
# endif
# ifdef XMRIG_ALGO_CN_GPU
m_map[Algorithm::CN_GPU] = new cn_hash_fun_array{};
m_map[Algorithm::CN_GPU]->data[AV_SINGLE][Assembly::NONE] = cryptonight_single_hash_gpu<Algorithm::CN_GPU, false>;
m_map[Algorithm::CN_GPU]->data[AV_SINGLE_SOFT][Assembly::NONE] = cryptonight_single_hash_gpu<Algorithm::CN_GPU, true>;
# endif
# ifdef XMRIG_ALGO_ARGON2
m_map[Algorithm::AR2_CHUKWA] = new cn_hash_fun_array{};
m_map[Algorithm::AR2_CHUKWA]->data[AV_SINGLE][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_CHUKWA>;
@ -310,12 +316,6 @@ xmrig::CnHash::CnHash()
m_map[Algorithm::ASTROBWT_DERO]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO>;
# endif
# ifdef XMRIG_ALGO_CN_GPU
m_map[Algorithm::CN_GPU] = new cn_hash_fun_array{};
m_map[Algorithm::CN_GPU]->data[AV_SINGLE][Assembly::NONE] = cryptonight_single_hash_gpu<Algorithm::CN_GPU, false>;
m_map[Algorithm::CN_GPU]->data[AV_SINGLE_SOFT][Assembly::NONE] = cryptonight_single_hash_gpu<Algorithm::CN_GPU, true>;
# endif
# ifdef XMRIG_ALGO_GHOSTRIDER
ADD_FN(Algorithm::CN_GR_0);
ADD_FN(Algorithm::CN_GR_1);

View file

@ -370,22 +370,6 @@ const static uint8_t test_output_pico_tlo[256] = {
#endif
#ifdef XMRIG_ALGO_CN_GPU
// "cn/gpu"
const static uint8_t test_output_gpu[160] = {
0xE5, 0x5C, 0xB2, 0x3E, 0x51, 0x64, 0x9A, 0x59, 0xB1, 0x27, 0xB9, 0x6B, 0x51, 0x5F, 0x2B, 0xF7,
0xBF, 0xEA, 0x19, 0x97, 0x41, 0xA0, 0x21, 0x6C, 0xF8, 0x38, 0xDE, 0xD0, 0x6E, 0xFF, 0x82, 0xDF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif
#ifdef XMRIG_ALGO_CN_FEMTO
// "cn/upx2"
const static uint8_t test_output_femto_upx2[256] = {
@ -403,6 +387,23 @@ const static uint8_t test_output_femto_upx2[256] = {
#endif
#ifdef XMRIG_ALGO_CN_GPU
// "cn/gpu"
const static uint8_t test_output_gpu[160] = {
0xE5, 0x5C, 0xB2, 0x3E, 0x51, 0x64, 0x9A, 0x59, 0xB1, 0x27, 0xB9, 0x6B, 0x51, 0x5F, 0x2B, 0xF7,
0xBF, 0xEA, 0x19, 0x97, 0x41, 0xA0, 0x21, 0x6C, 0xF8, 0x38, 0xDE, 0xD0, 0x6E, 0xFF, 0x82, 0xDF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
#endif
#ifdef XMRIG_ALGO_ARGON2
// "argon2/chukwa"
const static uint8_t argon2_chukwa_test_out[256] = {

View file

@ -420,7 +420,6 @@ static NOINLINE void cn_implode_scratchpad(cryptonight_ctx *ctx)
# else
constexpr bool IS_HEAVY = props.isHeavy();
# endif
constexpr size_t N = (props.memory() / sizeof(__m128i)) / (props.half_mem() ? 2 : 1);
__m128i xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7;
@ -841,8 +840,11 @@ namespace xmrig {
template<size_t MEM>
void cn_explode_scratchpad_gpu(const uint8_t *input, uint8_t *output)
static NOINLINE void cn_explode_scratchpad_gpu(cryptonight_ctx *ctx)
{
const uint8_t* input = reinterpret_cast<const uint8_t*>(ctx->state);
uint8_t* output = reinterpret_cast<uint8_t*>(ctx->memory);
constexpr size_t hash_size = 200; // 25x8 bytes
alignas(16) uint64_t hash[25];
@ -866,12 +868,12 @@ void cn_explode_scratchpad_gpu(const uint8_t *input, uint8_t *output)
template<Algorithm::Id ALGO, bool SOFT_AES>
inline void cryptonight_single_hash_gpu(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t)
inline void cryptonight_single_hash_gpu(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
{
constexpr CnAlgo<ALGO> props;
keccak(input, size, ctx[0]->state);
cn_explode_scratchpad_gpu<props.memory()>(ctx[0]->state, ctx[0]->memory);
cn_explode_scratchpad_gpu<props.memory()>(ctx[0]);
# ifdef _MSC_VER
_control87(RC_NEAR, MCW_RC);

View file

@ -518,13 +518,13 @@ void (*vaes_instances[])() = {
VAES_Instance<Algorithm::CN_PICO_0>,
VAES_Instance<Algorithm::CN_PICO_TLO>,
VAES_Instance<Algorithm::CN_UPX2>,
VAES_Instance<Algorithm::CN_GPU>,
VAES_Instance<Algorithm::CN_GR_0>,
VAES_Instance<Algorithm::CN_GR_1>,
VAES_Instance<Algorithm::CN_GR_2>,
VAES_Instance<Algorithm::CN_GR_3>,
VAES_Instance<Algorithm::CN_GR_4>,
VAES_Instance<Algorithm::CN_GR_5>,
VAES_Instance<Algorithm::CN_GPU>,
};