1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-07-02 06:54:30 -04:00

Compare commits

..

21 Commits

Author SHA1 Message Date
pdxwebdev 8e9612f8c0 Merge 4f5103480a into 1bbbff7d17 2022-05-20 23:06:40 -04:00
xmrig 1bbbff7d17 Merge pull request #3054 from SChernykh/dev
Fixes for 32-bit ARM
2022-05-21 09:57:17 +07:00
SChernykh 97683e5719 Fixes for 32-bit ARM 2022-05-20 21:16:10 +02:00
xmrig 059d5d8421 Merge pull request #3051 from SChernykh/dev
Fixed unaligned memory read in DMI
2022-05-20 09:11:26 +07:00
SChernykh 285719cde4 Fixed unaligned memory read in DMI 2022-05-19 20:56:19 +02:00
xmrig c877ba8145 Merge pull request #3042 from SChernykh/dev
Fixed being unable to resume from pause-on-battery
2022-05-06 02:14:52 +07:00
SChernykh 6793981066 Fixed being unable to resume from pause-on-battery
Fixes #3041
2022-05-05 21:13:02 +02:00
xmrig 1ae9a4e428 Merge pull request #3031 from SChernykh/dev
Fixed --cpu-priority not working sometimes
2022-04-20 07:44:33 +07:00
SChernykh 0e57053c5a Fixed --cpu-priority not working sometimes 2022-04-19 19:57:12 +02:00
xmrig 232d2d6dc5 Merge pull request #3020 from SChernykh/dev
Removed old AstroBWT algorithm
2022-04-15 16:03:26 +07:00
SChernykh a3cb74f29b Removed old AstroBWT algorithm
It's not used anywhere now.
2022-04-15 10:59:31 +02:00
pdxwebdev 4f5103480a Merge branch 'dev' into feature/yadacoin 2022-04-08 11:51:35 -07:00
XMRig 56753d7c4a v6.17.1-dev 2022-04-06 01:58:24 +07:00
XMRig f7b9e3ca67 Merge branch 'master' into dev 2022-04-06 01:58:03 +07:00
pdxwebdev 0549d936c2 Update Job.cpp 2022-03-25 01:13:05 -07:00
pdxwebdev fbc3a04221 Update Job.h 2022-03-25 01:08:31 -07:00
pdxwebdev 01129fcc40 Merge branch 'dev' into feature/yadacoin 2022-03-25 01:01:22 -07:00
pdxwebdev 07231af6ab Merge branch 'dev' into feature/yadacoin 2022-02-06 13:25:32 -08:00
pdxwebdev 396f003edc Merge branch 'dev' into feature/yadacoin 2022-02-04 19:27:02 -08:00
pdxwebdev 0f47bfb1b5 Merge branch 'dev' into feature/yadacoin 2022-01-29 16:53:49 -08:00
Matt Vogel 8c9b48851e Add "rx/yada" algorithm 2021-12-10 13:49:40 -08:00
47 changed files with 3931 additions and 4168 deletions
+5
View File
@@ -1,3 +1,6 @@
# v6.18.0
- [#2411](https://github.com/xmrig/xmrig/pull/2411) Added support for Yada (`rx/yada` algorithm).
# v6.17.0 # v6.17.0
- [#2954](https://github.com/xmrig/xmrig/pull/2954) **Dero HE fork support (`astrobwt/v2` algorithm).** - [#2954](https://github.com/xmrig/xmrig/pull/2954) **Dero HE fork support (`astrobwt/v2` algorithm).**
- [#2961](https://github.com/xmrig/xmrig/pull/2961) Dero HE (`astrobwt/v2`) CUDA config generator. - [#2961](https://github.com/xmrig/xmrig/pull/2961) Dero HE (`astrobwt/v2`) CUDA config generator.
@@ -10,6 +13,7 @@
- [#2908](https://github.com/xmrig/xmrig/pull/2908) Added MSVC/2022 to `version.h`. - [#2908](https://github.com/xmrig/xmrig/pull/2908) Added MSVC/2022 to `version.h`.
- [#2910](https://github.com/xmrig/xmrig/issues/2910) Fixed donation for GhostRider/RTM. - [#2910](https://github.com/xmrig/xmrig/issues/2910) Fixed donation for GhostRider/RTM.
# v6.16.3 # v6.16.3
- [#2778](https://github.com/xmrig/xmrig/pull/2778) Fixed `READY threads X/X` display after algorithm switching. - [#2778](https://github.com/xmrig/xmrig/pull/2778) Fixed `READY threads X/X` display after algorithm switching.
- [#2782](https://github.com/xmrig/xmrig/pull/2782) Updated GhostRider documentation. - [#2782](https://github.com/xmrig/xmrig/pull/2782) Updated GhostRider documentation.
@@ -22,6 +26,7 @@
- [#2882](https://github.com/xmrig/xmrig/pull/2882) Fixed ARMv7 compilation. - [#2882](https://github.com/xmrig/xmrig/pull/2882) Fixed ARMv7 compilation.
- [#2893](https://github.com/xmrig/xmrig/pull/2893) KawPow OpenCL: use separate UV loop for building programs. - [#2893](https://github.com/xmrig/xmrig/pull/2893) KawPow OpenCL: use separate UV loop for building programs.
# v6.16.2 # v6.16.2
- [#2751](https://github.com/xmrig/xmrig/pull/2751) Fixed crash on CPUs supporting VAES and running GCC-compiled xmrig. - [#2751](https://github.com/xmrig/xmrig/pull/2751) Fixed crash on CPUs supporting VAES and running GCC-compiled xmrig.
- [#2761](https://github.com/xmrig/xmrig/pull/2761) Fixed broken auto-tuning in GCC Windows build. - [#2761](https://github.com/xmrig/xmrig/pull/2761) Fixed broken auto-tuning in GCC Windows build.
+1
View File
@@ -7,6 +7,7 @@ option(WITH_CN_HEAVY "Enable CryptoNight-Heavy algorithms family" ON)
option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON) option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON)
option(WITH_CN_FEMTO "Enable CryptoNight-UPX2 algorithm" ON) option(WITH_CN_FEMTO "Enable CryptoNight-UPX2 algorithm" ON)
option(WITH_RANDOMX "Enable RandomX algorithms family" ON) option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
option(WITH_RX_YADA "Enable RandomX YADA algorithm (requires RandomX)" ON)
option(WITH_ARGON2 "Enable Argon2 algorithms family" ON) option(WITH_ARGON2 "Enable Argon2 algorithms family" ON)
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON) option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
option(WITH_KAWPOW "Enable KawPow algorithms family" ON) option(WITH_KAWPOW "Enable KawPow algorithms family" ON)
+16
View File
@@ -42,6 +42,14 @@ if (WITH_RANDOMX)
src/crypto/rx/RxVm.cpp src/crypto/rx/RxVm.cpp
) )
if (WITH_RX_YADA)
add_definitions(/DXMRIG_ALGO_RX_YADA)
message("-- WITH_RX_YADA=ON (YADACoin algorithm)")
else()
remove_definitions(/DXMRIG_ALGO_RX_YADA)
message("-- WITH_RX_YADA=OFF (YADACoin algorithm)")
endif()
if (WITH_ASM AND CMAKE_C_COMPILER_ID MATCHES MSVC) if (WITH_ASM AND CMAKE_C_COMPILER_ID MATCHES MSVC)
enable_language(ASM_MASM) enable_language(ASM_MASM)
list(APPEND SOURCES_CRYPTO list(APPEND SOURCES_CRYPTO
@@ -137,4 +145,12 @@ if (WITH_RANDOMX)
endif() endif()
else() else()
remove_definitions(/DXMRIG_ALGO_RANDOMX) remove_definitions(/DXMRIG_ALGO_RANDOMX)
if (WITH_RX_YADA)
message("-- WITH_RANDOMX=OFF but WITH_RX_YADA=ON... forcing OFF")
set(WITH_RX_YADA OFF)
endif()
# intentionally not an `else` in case above negated it
if (NOT WITH_RX_YADA)
remove_definitions(/DXMRIG_ALGO_RX_YADA)
endif()
endif() endif()
+1
View File
@@ -12,6 +12,7 @@ Option `coin` useful for pools without [algorithm negotiation](https://xmrig.com
| Name | Memory | Version | Description | Notes | | Name | Memory | Version | Description | Notes |
|------|--------|---------|-------------|-------| |------|--------|---------|-------------|-------|
| `rx/yada` | 2 MB | 6.17.0+ | RandomYADA (RandomX variant for Yada). | |
| `kawpow` | - | 6.0.0+ | KawPow (Ravencoin) | GPU only | | `kawpow` | - | 6.0.0+ | KawPow (Ravencoin) | GPU only |
| `rx/keva` | 1 MB | 5.9.0+ | RandomKEVA (RandomX variant for Keva). | | | `rx/keva` | 1 MB | 5.9.0+ | RandomKEVA (RandomX variant for Keva). | |
| `astrobwt` | 20 MB | 5.8.0+ | AstroBWT (Dero). | | | `astrobwt` | 20 MB | 5.8.0+ | AstroBWT (Dero). | |
+1
View File
@@ -52,6 +52,7 @@ function rx()
'randomx_constants_arqma.h', 'randomx_constants_arqma.h',
'randomx_constants_keva.h', 'randomx_constants_keva.h',
'randomx_constants_graft.h', 'randomx_constants_graft.h',
'randomx_constants_yada.h',
'aes.cl', 'aes.cl',
'blake2b.cl', 'blake2b.cl',
'randomx_vm.cl', 'randomx_vm.cl',
+1 -1
View File
@@ -109,7 +109,7 @@ private:
} }
alignas(16) uint8_t m_blobs[2][Job::kMaxBlobSize * N]{}; alignas(8) uint8_t m_blobs[2][Job::kMaxBlobSize * N]{};
Job m_jobs[2]; Job m_jobs[2];
uint32_t m_rounds[2] = { 0, 0 }; uint32_t m_rounds[2] = { 0, 0 };
uint64_t m_nonce_mask[2] = { 0, 0 }; uint64_t m_nonce_mask[2] = { 0, 0 };
-4
View File
@@ -436,10 +436,6 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
out.AddMember("argon2-impl", argon2::Impl::name().toJSON(), allocator); out.AddMember("argon2-impl", argon2::Impl::name().toJSON(), allocator);
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
out.AddMember("astrobwt-max-size", cpu.astrobwtMaxSize(), allocator);
# endif
out.AddMember("hugepages", d_ptr->hugePages(2, doc), allocator); out.AddMember("hugepages", d_ptr->hugePages(2, doc), allocator);
out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (d_ptr->ways() * d_ptr->algo.l3()) : 0), allocator); out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (d_ptr->ways() * d_ptr->algo.l3()) : 0), allocator);
-28
View File
@@ -45,11 +45,6 @@ const char *CpuConfig::kAsm = "asm";
const char *CpuConfig::kArgon2Impl = "argon2-impl"; const char *CpuConfig::kArgon2Impl = "argon2-impl";
#endif #endif
#ifdef XMRIG_ALGO_ASTROBWT
const char *CpuConfig::kAstroBWTMaxSize = "astrobwt-max-size";
const char *CpuConfig::kAstroBWTAVX2 = "astrobwt-avx2";
#endif
extern template class Threads<CpuThreads>; extern template class Threads<CpuThreads>;
@@ -89,11 +84,6 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kArgon2Impl), m_argon2Impl.toJSON(), allocator); obj.AddMember(StringRef(kArgon2Impl), m_argon2Impl.toJSON(), allocator);
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
obj.AddMember(StringRef(kAstroBWTAVX2), m_astrobwtAVX2, allocator);
# endif
m_threads.toJSON(obj, doc); m_threads.toJSON(obj, doc);
return obj; return obj;
@@ -158,24 +148,6 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
m_argon2Impl = Json::getString(value, kArgon2Impl); m_argon2Impl = Json::getString(value, kArgon2Impl);
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
const auto& astroBWTMaxSize = Json::getValue(value, kAstroBWTMaxSize);
if (astroBWTMaxSize.IsNull() || !astroBWTMaxSize.IsInt()) {
m_shouldSave = true;
}
else {
m_astrobwtMaxSize = std::min(std::max(astroBWTMaxSize.GetInt(), 400), 1200);
}
const auto& astroBWTAVX2 = Json::getValue(value, kAstroBWTAVX2);
if (astroBWTAVX2.IsNull() || !astroBWTAVX2.IsBool()) {
m_shouldSave = true;
}
else {
m_astrobwtAVX2 = astroBWTAVX2.GetBool();
}
# endif
m_threads.read(value); m_threads.read(value);
generate(); generate();
-9
View File
@@ -56,11 +56,6 @@ public:
static const char *kArgon2Impl; static const char *kArgon2Impl;
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
static const char *kAstroBWTMaxSize;
static const char *kAstroBWTAVX2;
# endif
CpuConfig() = default; CpuConfig() = default;
bool isHwAES() const; bool isHwAES() const;
@@ -69,7 +64,6 @@ public:
std::vector<CpuLaunchData> get(const Miner *miner, const Algorithm &algorithm) const; std::vector<CpuLaunchData> get(const Miner *miner, const Algorithm &algorithm) const;
void read(const rapidjson::Value &value); void read(const rapidjson::Value &value);
inline bool astrobwtAVX2() const { return m_astrobwtAVX2; }
inline bool isEnabled() const { return m_enabled; } inline bool isEnabled() const { return m_enabled; }
inline bool isHugePages() const { return m_hugePageSize > 0; } inline bool isHugePages() const { return m_hugePageSize > 0; }
inline bool isHugePagesJit() const { return m_hugePagesJit; } inline bool isHugePagesJit() const { return m_hugePagesJit; }
@@ -78,7 +72,6 @@ public:
inline const Assembly &assembly() const { return m_assembly; } inline const Assembly &assembly() const { return m_assembly; }
inline const String &argon2Impl() const { return m_argon2Impl; } inline const String &argon2Impl() const { return m_argon2Impl; }
inline const Threads<CpuThreads> &threads() const { return m_threads; } inline const Threads<CpuThreads> &threads() const { return m_threads; }
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
inline int priority() const { return m_priority; } inline int priority() const { return m_priority; }
inline size_t hugePageSize() const { return m_hugePageSize * 1024U; } inline size_t hugePageSize() const { return m_hugePageSize * 1024U; }
inline uint32_t limit() const { return m_limit; } inline uint32_t limit() const { return m_limit; }
@@ -96,12 +89,10 @@ private:
AesMode m_aes = AES_AUTO; AesMode m_aes = AES_AUTO;
Assembly m_assembly; Assembly m_assembly;
bool m_astrobwtAVX2 = false;
bool m_enabled = true; bool m_enabled = true;
bool m_hugePagesJit = false; bool m_hugePagesJit = false;
bool m_shouldSave = false; bool m_shouldSave = false;
bool m_yield = true; bool m_yield = true;
int m_astrobwtMaxSize = 550;
int m_memoryPool = 0; int m_memoryPool = 0;
int m_priority = -1; int m_priority = -1;
size_t m_hugePageSize = kDefaultHugePageSizeKb; size_t m_hugePageSize = kDefaultHugePageSizeKb;
+7 -1
View File
@@ -137,6 +137,13 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
count += threads.move(Algorithm::kRX_WOW, std::move(wow)); count += threads.move(Algorithm::kRX_WOW, std::move(wow));
} }
# ifdef XMRIG_ALGO_RX_YADA
if (!threads.isExist(Algorithm::RX_YADA)) {
auto yada = cpuInfo->threads(Algorithm::RX_YADA, limit);
count += threads.move(Algorithm::kRX_YADA, std::move(yada));
}
# endif
count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit); count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit);
return count; return count;
@@ -164,7 +171,6 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32
count += threads.move(Algorithm::kASTROBWT_DERO_2, std::move(v2)); count += threads.move(Algorithm::kASTROBWT_DERO_2, std::move(v2));
} }
count += generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, limit);
return count; return count;
} }
#endif #endif
-2
View File
@@ -35,11 +35,9 @@
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads, const std::vector<int64_t>& affinities) : xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads, const std::vector<int64_t>& affinities) :
algorithm(algorithm), algorithm(algorithm),
assembly(config.assembly()), assembly(config.assembly()),
astrobwtAVX2(config.astrobwtAVX2()),
hugePages(config.isHugePages()), hugePages(config.isHugePages()),
hwAES(config.isHwAES()), hwAES(config.isHwAES()),
yield(config.isYield()), yield(config.isYield()),
astrobwtMaxSize(config.astrobwtMaxSize()),
priority(config.priority()), priority(config.priority()),
affinity(thread.affinity()), affinity(thread.affinity()),
miner(miner), miner(miner),
-2
View File
@@ -58,11 +58,9 @@ public:
const Algorithm algorithm; const Algorithm algorithm;
const Assembly assembly; const Assembly assembly;
const bool astrobwtAVX2;
const bool hugePages; const bool hugePages;
const bool hwAES; const bool hwAES;
const bool yield; const bool yield;
const int astrobwtMaxSize;
const int priority; const int priority;
const int64_t affinity; const int64_t affinity;
const Miner *miner; const Miner *miner;
+2 -12
View File
@@ -73,11 +73,9 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
Worker(id, data.affinity, data.priority), Worker(id, data.affinity, data.priority),
m_algorithm(data.algorithm), m_algorithm(data.algorithm),
m_assembly(data.assembly), m_assembly(data.assembly),
m_astrobwtAVX2(data.astrobwtAVX2),
m_hwAES(data.hwAES), m_hwAES(data.hwAES),
m_yield(data.yield), m_yield(data.yield),
m_av(data.av()), m_av(data.av()),
m_astrobwtMaxSize(data.astrobwtMaxSize * 1000),
m_miner(data.miner), m_miner(data.miner),
m_threads(data.threads), m_threads(data.threads),
m_ctx() m_ctx()
@@ -224,7 +222,6 @@ bool xmrig::CpuWorker<N>::selfTest()
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT # ifdef XMRIG_ALGO_ASTROBWT
if (m_algorithm.id() == Algorithm::ASTROBWT_DERO) return verify(Algorithm::ASTROBWT_DERO, astrobwt_dero_test_out);
if (m_algorithm.id() == Algorithm::ASTROBWT_DERO_2) return verify(Algorithm::ASTROBWT_DERO_2, astrobwt_dero_2_test_out); if (m_algorithm.id() == Algorithm::ASTROBWT_DERO_2) return verify(Algorithm::ASTROBWT_DERO_2, astrobwt_dero_2_test_out);
# endif # endif
@@ -319,15 +316,8 @@ void xmrig::CpuWorker<N>::start()
# ifdef XMRIG_ALGO_ASTROBWT # ifdef XMRIG_ALGO_ASTROBWT
case Algorithm::ASTROBWT: case Algorithm::ASTROBWT:
if (job.algorithm().id() == Algorithm::ASTROBWT_DERO) { if (!astrobwt::astrobwt_dero_v2(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash)) {
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize, m_astrobwtAVX2)) { valid = false;
valid = false;
}
}
else {
if (!astrobwt::astrobwt_dero_v2(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash)) {
valid = false;
}
} }
break; break;
# endif # endif
+1 -3
View File
@@ -83,14 +83,12 @@ private:
void allocateCnCtx(); void allocateCnCtx();
void consumeJob(); void consumeJob();
alignas(16) uint8_t m_hash[N * 32]{ 0 }; alignas(8) uint8_t m_hash[N * 32]{ 0 };
const Algorithm m_algorithm; const Algorithm m_algorithm;
const Assembly m_assembly; const Assembly m_assembly;
const bool m_astrobwtAVX2;
const bool m_hwAES; const bool m_hwAES;
const bool m_yield; const bool m_yield;
const CnHash::AlgoVariant m_av; const CnHash::AlgoVariant m_av;
const int m_astrobwtMaxSize;
const Miner *m_miner; const Miner *m_miner;
const size_t m_threads; const size_t m_threads;
cryptonight_ctx *m_ctx[N]; cryptonight_ctx *m_ctx[N];
@@ -318,13 +318,6 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
size_t scratchpad = algorithm.l3(); size_t scratchpad = algorithm.l3();
uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1; uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1;
# ifdef XMRIG_ALGO_ASTROBWT
if (algorithm == Algorithm::ASTROBWT_DERO) {
// Use fake low value to force usage of all available cores for AstroBWT (taking 'limit' into account)
scratchpad = 16 * 1024;
}
# endif
if (cache->attr->cache.depth == 3) { if (cache->attr->cache.depth == 3) {
for (size_t i = 0; i < cache->arity; ++i) { for (size_t i = 0; i < cache->arity; ++i) {
hwloc_obj_t l2 = cache->children[i]; hwloc_obj_t l2 = cache->children[i];
-6
View File
@@ -220,12 +220,6 @@ public:
size_t algo_l3 = algo.l3(); size_t algo_l3 = algo.l3();
# ifdef XMRIG_ALGO_ASTROBWT
if (algo.id() == Algorithm::ASTROBWT_DERO) {
algo_l3 = CudaAstroBWTRunner::BWT_DATA_STRIDE * 17 + 1024;
}
# endif
size_t i = 0; size_t i = 0;
for (const auto &data : threads) { for (const auto &data : threads) {
size_t mem_used = (data.thread.threads() * data.thread.blocks()) * algo_l3 / oneMiB; size_t mem_used = (data.thread.threads() * data.thread.blocks()) * algo_l3 / oneMiB;
+9 -1
View File
@@ -115,6 +115,9 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
auto wow = CudaThreads(devices, Algorithm::RX_WOW); auto wow = CudaThreads(devices, Algorithm::RX_WOW);
auto arq = CudaThreads(devices, Algorithm::RX_ARQ); auto arq = CudaThreads(devices, Algorithm::RX_ARQ);
auto kva = CudaThreads(devices, Algorithm::RX_KEVA); auto kva = CudaThreads(devices, Algorithm::RX_KEVA);
# ifdef XMRIG_ALGO_RX_YADA
auto yda = CudaThreads(devices, Algorithm::RX_YADA);
# endif
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) { if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
count += threads.move(Algorithm::kRX_WOW, std::move(wow)); count += threads.move(Algorithm::kRX_WOW, std::move(wow));
@@ -128,6 +131,12 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
count += threads.move(Algorithm::kRX_KEVA, std::move(kva)); count += threads.move(Algorithm::kRX_KEVA, std::move(kva));
} }
# ifdef XMRIG_ALGO_RX_YADA
if (!threads.isExist(Algorithm::RX_YADA) && yda != rx) {
count += threads.move(Algorithm::kRX_YADA, std::move(yda));
}
# endif
count += threads.move(Algorithm::kRX, std::move(rx)); count += threads.move(Algorithm::kRX, std::move(rx));
return count; return count;
@@ -145,7 +154,6 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<CudaThreads> &threads, const
count += threads.move(Algorithm::kASTROBWT_DERO_2, CudaThreads(devices, Algorithm::ASTROBWT_DERO_2)); count += threads.move(Algorithm::kASTROBWT_DERO_2, CudaThreads(devices, Algorithm::ASTROBWT_DERO_2));
} }
count += generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
return count; return count;
} }
#endif #endif
-6
View File
@@ -204,12 +204,6 @@ public:
size_t algo_l3 = algo.l3(); size_t algo_l3 = algo.l3();
# ifdef XMRIG_ALGO_ASTROBWT
if (algo.id() == Algorithm::ASTROBWT_DERO) {
algo_l3 = OclAstroBWTRunner::BWT_DATA_STRIDE * 17 + 324;
}
# endif
size_t i = 0; size_t i = 0;
for (const auto &data : threads) { for (const auto &data : threads) {
size_t mem_used = data.thread.intensity() * algo_l3 / oneMiB; size_t mem_used = data.thread.intensity() * algo_l3 / oneMiB;
+9 -1
View File
@@ -113,6 +113,9 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<OclThreads> &threads, const
auto rx = OclThreads(devices, Algorithm::RX_0); auto rx = OclThreads(devices, Algorithm::RX_0);
auto wow = OclThreads(devices, Algorithm::RX_WOW); auto wow = OclThreads(devices, Algorithm::RX_WOW);
auto arq = OclThreads(devices, Algorithm::RX_ARQ); auto arq = OclThreads(devices, Algorithm::RX_ARQ);
# ifdef XMRIG_ALGO_RX_YADA
auto yda = OclThreads(devices, Algorithm::RX_YADA);
# endif
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) { if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
count += threads.move(Algorithm::kRX_WOW, std::move(wow)); count += threads.move(Algorithm::kRX_WOW, std::move(wow));
@@ -122,6 +125,12 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<OclThreads> &threads, const
count += threads.move(Algorithm::kRX_ARQ, std::move(arq)); count += threads.move(Algorithm::kRX_ARQ, std::move(arq));
} }
# ifdef XMRIG_ALGO_RX_YADA
if (!threads.isExist(Algorithm::RX_YADA) && yda != rx) {
count += threads.move(Algorithm::kRX_YADA, std::move(yda));
}
# endif
count += threads.move(Algorithm::kRX, std::move(rx)); count += threads.move(Algorithm::kRX, std::move(rx));
return count; return count;
@@ -139,7 +148,6 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<OclThreads>& threads, const
count += threads.move(Algorithm::kASTROBWT_DERO_2, OclThreads(devices, Algorithm::ASTROBWT_DERO_2)); count += threads.move(Algorithm::kASTROBWT_DERO_2, OclThreads(devices, Algorithm::ASTROBWT_DERO_2));
} }
count += generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
return count; return count;
} }
#endif #endif
+1
View File
@@ -24,6 +24,7 @@
#define ALGO_RX_SFX 0x72151273 #define ALGO_RX_SFX 0x72151273
#define ALGO_RX_KEVA 0x7214116b #define ALGO_RX_KEVA 0x7214116b
#define ALGO_RX_GRAFT 0x72151267 #define ALGO_RX_GRAFT 0x72151267
#define ALGO_RX_YADA 0x72151279
#define ALGO_AR2_CHUKWA 0x61130000 #define ALGO_AR2_CHUKWA 0x61130000
#define ALGO_AR2_CHUKWA_V2 0x61140000 #define ALGO_AR2_CHUKWA_V2 0x61140000
#define ALGO_AR2_WRKZ 0x61120000 #define ALGO_AR2_WRKZ 0x61120000
+3 -2
View File
@@ -2,7 +2,7 @@
namespace xmrig { namespace xmrig {
static const char cryptonight_cl[61520] = { static const char cryptonight_cl[61552] = {
0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x0a,0x23,0x75,0x6e,0x64,0x65,0x66,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x0a,0x23,0x65,0x6e,0x64, 0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x0a,0x23,0x75,0x6e,0x64,0x65,0x66,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x0a,0x23,0x65,0x6e,0x64,
0x69,0x66,0x0a,0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x0a,0x23,0x64,0x65,0x66,0x69, 0x69,0x66,0x0a,0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x0a,0x23,0x64,0x65,0x66,0x69,
0x6e,0x65,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x20,0x73,0x74,0x61,0x74,0x69,0x63,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53, 0x6e,0x65,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x20,0x73,0x74,0x61,0x74,0x69,0x63,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53,
@@ -36,7 +36,8 @@ static const char cryptonight_cl[61520] = {
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, 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, 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, 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, 0x31,0x35,0x31,0x32,0x36,0x37,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x52,0x58,0x5f,0x59,0x41,0x44,0x41,0x20,0x30,0x78,0x37,0x32,
0x31,0x35,0x31,0x32,0x37,0x39,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, 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, 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, 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,
+2
View File
@@ -10,6 +10,8 @@
#include "randomx_constants_keva.h" #include "randomx_constants_keva.h"
#elif (ALGO == ALGO_RX_GRAFT) #elif (ALGO == ALGO_RX_GRAFT)
#include "randomx_constants_graft.h" #include "randomx_constants_graft.h"
#elif (ALGO == ALGO_RX_YADA)
#include "randomx_constants_yada.h"
#endif #endif
#include "aes.cl" #include "aes.cl"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,96 @@
/*
Copyright (c) 2019 SChernykh
This file is part of RandomX OpenCL.
RandomX OpenCL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
RandomX OpenCL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
*/
//Dataset base size in bytes. Must be a power of 2.
#define RANDOMX_DATASET_BASE_SIZE 2147483648
//Dataset extra size. Must be divisible by 64.
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
//Scratchpad L3 size in bytes. Must be a power of 2.
#define RANDOMX_SCRATCHPAD_L3 2097152
//Scratchpad L2 size in bytes. Must be a power of two and less than or equal to RANDOMX_SCRATCHPAD_L3.
#define RANDOMX_SCRATCHPAD_L2 262144
//Scratchpad L1 size in bytes. Must be a power of two (minimum 64) and less than or equal to RANDOMX_SCRATCHPAD_L2.
#define RANDOMX_SCRATCHPAD_L1 16384
//Jump condition mask size in bits.
#define RANDOMX_JUMP_BITS 8
//Jump condition mask offset in bits. The sum of RANDOMX_JUMP_BITS and RANDOMX_JUMP_OFFSET must not exceed 16.
#define RANDOMX_JUMP_OFFSET 8
//Integer instructions
#define RANDOMX_FREQ_IADD_RS 16
#define RANDOMX_FREQ_IADD_M 7
#define RANDOMX_FREQ_ISUB_R 16
#define RANDOMX_FREQ_ISUB_M 7
#define RANDOMX_FREQ_IMUL_R 16
#define RANDOMX_FREQ_IMUL_M 4
#define RANDOMX_FREQ_IMULH_R 4
#define RANDOMX_FREQ_IMULH_M 1
#define RANDOMX_FREQ_ISMULH_R 4
#define RANDOMX_FREQ_ISMULH_M 1
#define RANDOMX_FREQ_IMUL_RCP 8
#define RANDOMX_FREQ_INEG_R 2
#define RANDOMX_FREQ_IXOR_R 15
#define RANDOMX_FREQ_IXOR_M 5
#define RANDOMX_FREQ_IROR_R 8
#define RANDOMX_FREQ_IROL_R 2
#define RANDOMX_FREQ_ISWAP_R 4
//Floating point instructions
#define RANDOMX_FREQ_FSWAP_R 4
#define RANDOMX_FREQ_FADD_R 16
#define RANDOMX_FREQ_FADD_M 5
#define RANDOMX_FREQ_FSUB_R 16
#define RANDOMX_FREQ_FSUB_M 5
#define RANDOMX_FREQ_FSCAL_R 6
#define RANDOMX_FREQ_FMUL_R 32
#define RANDOMX_FREQ_FDIV_M 4
#define RANDOMX_FREQ_FSQRT_R 6
//Control instructions
#define RANDOMX_FREQ_CBRANCH 25
#define RANDOMX_FREQ_CFROUND 1
//Store instruction
#define RANDOMX_FREQ_ISTORE 16
//No-op instruction
#define RANDOMX_FREQ_NOP 0
#define RANDOMX_DATASET_ITEM_SIZE 64
#define RANDOMX_PROGRAM_SIZE 256
#define HASH_SIZE 64
#define ENTROPY_SIZE (128 + RANDOMX_PROGRAM_SIZE * 8)
#define REGISTERS_SIZE 256
#define IMM_BUF_SIZE (RANDOMX_PROGRAM_SIZE * 4 - REGISTERS_SIZE)
#define IMM_INDEX_COUNT ((IMM_BUF_SIZE / 4) - 2)
#define VM_STATE_SIZE (REGISTERS_SIZE + IMM_BUF_SIZE + RANDOMX_PROGRAM_SIZE * 4)
#define ROUNDING_MODE (RANDOMX_FREQ_CFROUND ? -1 : 0)
// Scratchpad L1/L2/L3 bits
#define LOC_L1 (32 - 14)
#define LOC_L2 (32 - 18)
#define LOC_L3 (32 - 21)
+14 -3
View File
@@ -82,6 +82,9 @@ const char *Algorithm::kRX_ARQ = "rx/arq";
const char *Algorithm::kRX_GRAFT = "rx/graft"; const char *Algorithm::kRX_GRAFT = "rx/graft";
const char *Algorithm::kRX_SFX = "rx/sfx"; const char *Algorithm::kRX_SFX = "rx/sfx";
const char *Algorithm::kRX_KEVA = "rx/keva"; const char *Algorithm::kRX_KEVA = "rx/keva";
#ifdef XMRIG_ALGO_RX_YADA
const char *Algorithm::kRX_YADA = "rx/yada";
#endif
#endif #endif
#ifdef XMRIG_ALGO_ARGON2 #ifdef XMRIG_ALGO_ARGON2
@@ -154,6 +157,9 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
ALGO_NAME(RX_GRAFT), ALGO_NAME(RX_GRAFT),
ALGO_NAME(RX_SFX), ALGO_NAME(RX_SFX),
ALGO_NAME(RX_KEVA), ALGO_NAME(RX_KEVA),
# ifdef XMRIG_ALGO_RX_YADA
ALGO_NAME(RX_YADA),
# endif
# endif # endif
# ifdef XMRIG_ALGO_ARGON2 # ifdef XMRIG_ALGO_ARGON2
@@ -163,7 +169,6 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT # ifdef XMRIG_ALGO_ASTROBWT
ALGO_NAME(ASTROBWT_DERO),
ALGO_NAME(ASTROBWT_DERO_2), ALGO_NAME(ASTROBWT_DERO_2),
# endif # endif
@@ -274,6 +279,10 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
ALGO_ALIAS(RX_SFX, "randomsfx"), ALGO_ALIAS(RX_SFX, "randomsfx"),
ALGO_ALIAS_AUTO(RX_KEVA), ALGO_ALIAS(RX_KEVA, "randomx/keva"), ALGO_ALIAS_AUTO(RX_KEVA), ALGO_ALIAS(RX_KEVA, "randomx/keva"),
ALGO_ALIAS(RX_KEVA, "randomkeva"), ALGO_ALIAS(RX_KEVA, "randomkeva"),
# ifdef XMRIG_ALGO_RX_YADA
ALGO_ALIAS_AUTO(RX_YADA), ALGO_ALIAS(RX_YADA, "randomx/yada"),
ALGO_ALIAS(RX_YADA, "randomyada"),
# endif
# endif # endif
# ifdef XMRIG_ALGO_ARGON2 # ifdef XMRIG_ALGO_ARGON2
@@ -283,7 +292,6 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT # ifdef XMRIG_ALGO_ASTROBWT
ALGO_ALIAS_AUTO(ASTROBWT_DERO), ALGO_ALIAS(ASTROBWT_DERO, "astrobwt/dero"),
ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/v2"), ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/v2"),
ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/dero_he"), ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/dero_he"),
ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/derohe"), ALGO_ALIAS_AUTO(ASTROBWT_DERO_2), ALGO_ALIAS(ASTROBWT_DERO_2, "astrobwt/derohe"),
@@ -369,8 +377,11 @@ std::vector<xmrig::Algorithm> xmrig::Algorithm::all(const std::function<bool(con
CN_PICO_0, CN_PICO_TLO, CN_PICO_0, CN_PICO_TLO,
CN_UPX2, CN_UPX2,
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA, RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA,
# ifdef XMRIG_ALGO_RX_YADA
RX_YADA,
# endif
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ, AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
ASTROBWT_DERO, ASTROBWT_DERO_2, ASTROBWT_DERO_2,
KAWPOW_RVN, KAWPOW_RVN,
GHOSTRIDER_RTM GHOSTRIDER_RTM
}; };
+3 -9
View File
@@ -78,10 +78,10 @@ public:
RX_GRAFT = 0x72151267, // "rx/graft" RandomGRAFT (Graft). RX_GRAFT = 0x72151267, // "rx/graft" RandomGRAFT (Graft).
RX_SFX = 0x72151273, // "rx/sfx" RandomSFX (Safex Cash). RX_SFX = 0x72151273, // "rx/sfx" RandomSFX (Safex Cash).
RX_KEVA = 0x7214116b, // "rx/keva" RandomKEVA (Keva). RX_KEVA = 0x7214116b, // "rx/keva" RandomKEVA (Keva).
RX_YADA = 0x72151279, // "rx/yada" RandomYada (YadaCoin).
AR2_CHUKWA = 0x61130000, // "argon2/chukwa" Argon2id (Chukwa). AR2_CHUKWA = 0x61130000, // "argon2/chukwa" Argon2id (Chukwa).
AR2_CHUKWA_V2 = 0x61140000, // "argon2/chukwav2" Argon2id (Chukwa v2). AR2_CHUKWA_V2 = 0x61140000, // "argon2/chukwav2" Argon2id (Chukwa v2).
AR2_WRKZ = 0x61120000, // "argon2/wrkz" Argon2id (WRKZ) AR2_WRKZ = 0x61120000, // "argon2/wrkz" Argon2id (WRKZ)
ASTROBWT_DERO = 0x41000000, // "astrobwt" AstroBWT (Dero)
ASTROBWT_DERO_2 = 0x41110000, // "astrobwt/v2" AstroBWT (Dero HE) ASTROBWT_DERO_2 = 0x41110000, // "astrobwt/v2" AstroBWT (Dero HE)
KAWPOW_RVN = 0x6b0f0000, // "kawpow/rvn" KawPow (RVN) KAWPOW_RVN = 0x6b0f0000, // "kawpow/rvn" KawPow (RVN)
}; };
@@ -147,6 +147,7 @@ public:
static const char *kRX_GRAFT; static const char *kRX_GRAFT;
static const char *kRX_SFX; static const char *kRX_SFX;
static const char *kRX_KEVA; static const char *kRX_KEVA;
static const char *kRX_YADA;
# endif # endif
# ifdef XMRIG_ALGO_ARGON2 # ifdef XMRIG_ALGO_ARGON2
@@ -194,14 +195,7 @@ public:
inline uint32_t minIntensity() const { return ((m_id == GHOSTRIDER_RTM) ? 8 : 1); }; inline uint32_t minIntensity() const { return ((m_id == GHOSTRIDER_RTM) ? 8 : 1); };
inline uint32_t maxIntensity() const { return isCN() ? 5 : ((m_id == GHOSTRIDER_RTM) ? 8 : 1); }; inline uint32_t maxIntensity() const { return isCN() ? 5 : ((m_id == GHOSTRIDER_RTM) ? 8 : 1); };
inline size_t l3() const inline size_t l3() const { return l3(m_id); }
{
# ifdef XMRIG_ALGO_ASTROBWT
return m_id != ASTROBWT_DERO ? l3(m_id) : 0x100000 * 20;
# else
return l3(m_id);
# endif
}
inline bool operator!=(Algorithm::Id id) const { return m_id != id; } inline bool operator!=(Algorithm::Id id) const { return m_id != id; }
inline bool operator!=(const Algorithm &other) const { return !isEqual(other); } inline bool operator!=(const Algorithm &other) const { return !isEqual(other); }
+2 -1
View File
@@ -49,10 +49,11 @@ static const CoinInfo coinInfo[] = {
{ Algorithm::RX_0, "XMR", "Monero", 120, 1000000000000, YELLOW_BG_BOLD( WHITE_BOLD_S " monero ") }, { Algorithm::RX_0, "XMR", "Monero", 120, 1000000000000, YELLOW_BG_BOLD( WHITE_BOLD_S " monero ") },
{ Algorithm::CN_R, "SUMO", "Sumokoin", 240, 1000000000, BLUE_BG_BOLD( WHITE_BOLD_S " sumo ") }, { Algorithm::CN_R, "SUMO", "Sumokoin", 240, 1000000000, BLUE_BG_BOLD( WHITE_BOLD_S " sumo ") },
{ Algorithm::RX_ARQ, "ARQ", "ArQmA", 120, 1000000000, BLUE_BG_BOLD( WHITE_BOLD_S " arqma ") }, { Algorithm::RX_ARQ, "ARQ", "ArQmA", 120, 1000000000, BLUE_BG_BOLD( WHITE_BOLD_S " arqma ") },
{ Algorithm::ASTROBWT_DERO, "DERO", "DERO", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " dero ") }, { Algorithm::ASTROBWT_DERO_2, "DERO", "DERO", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " dero ") },
{ Algorithm::ASTROBWT_DERO_2, "DERO_HE", "DERO_HE", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " dero_he ") }, { Algorithm::ASTROBWT_DERO_2, "DERO_HE", "DERO_HE", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " dero_he ") },
{ Algorithm::RX_GRAFT, "GRFT", "Graft", 120, 10000000000, BLUE_BG_BOLD( WHITE_BOLD_S " graft ") }, { Algorithm::RX_GRAFT, "GRFT", "Graft", 120, 10000000000, BLUE_BG_BOLD( WHITE_BOLD_S " graft ") },
{ Algorithm::RX_KEVA, "KVA", "Kevacoin", 0, 0, MAGENTA_BG_BOLD(WHITE_BOLD_S " keva ") }, { Algorithm::RX_KEVA, "KVA", "Kevacoin", 0, 0, MAGENTA_BG_BOLD(WHITE_BOLD_S " keva ") },
{ Algorithm::RX_YADA, "YDA", "Yadacoin", 0, 0, MAGENTA_BG_BOLD(WHITE_BOLD_S " yada ") },
{ Algorithm::KAWPOW_RVN, "RVN", "Ravencoin", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " raven ") }, { Algorithm::KAWPOW_RVN, "RVN", "Ravencoin", 0, 0, BLUE_BG_BOLD( WHITE_BOLD_S " raven ") },
{ Algorithm::RX_WOW, "WOW", "Wownero", 300, 100000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " wownero ") }, { Algorithm::RX_WOW, "WOW", "Wownero", 300, 100000000000, MAGENTA_BG_BOLD(WHITE_BOLD_S " wownero ") },
}; };
+1
View File
@@ -39,6 +39,7 @@ public:
DERO_HE, DERO_HE,
GRAFT, GRAFT,
KEVA, KEVA,
YADA,
RAVEN, RAVEN,
WOWNERO, WOWNERO,
MAX MAX
-2
View File
@@ -111,8 +111,6 @@ public:
CPUMaxThreadsKey = 1026, CPUMaxThreadsKey = 1026,
MemoryPoolKey = 1027, MemoryPoolKey = 1027,
YieldKey = 1030, YieldKey = 1030,
AstroBWTMaxSizeKey = 1034,
AstroBWTAVX2Key = 1036,
Argon2ImplKey = 1039, Argon2ImplKey = 1039,
RandomXCacheQoSKey = 1040, RandomXCacheQoSKey = 1040,
+1 -1
View File
@@ -244,7 +244,7 @@ void xmrig::DaemonClient::connect()
} }
const xmrig::Algorithm algo = m_pool.algorithm(); const xmrig::Algorithm algo = m_pool.algorithm();
if ((algo == Algorithm::ASTROBWT_DERO) || (algo == Algorithm::ASTROBWT_DERO_2) || (m_coin == Coin::DERO) || (m_coin == Coin::DERO_HE)) { if ((algo == Algorithm::ASTROBWT_DERO_2) || (m_coin == Coin::DERO) || (m_coin == Coin::DERO_HE)) {
m_apiVersion = API_DERO; m_apiVersion = API_DERO;
} }
+16 -7
View File
@@ -112,14 +112,22 @@ bool xmrig::Job::setTarget(const char *target)
const auto raw = Cvt::fromHex(target, strlen(target)); const auto raw = Cvt::fromHex(target, strlen(target));
const size_t size = raw.size(); const size_t size = raw.size();
if (size == 4) { # ifdef XMRIG_ALGO_RX_YADA
m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast<const uint32_t *>(raw.data()))); if (algorithm() == Algorithm::RX_YADA) {
m_target = strtoull(target, nullptr, 16);
} }
else if (size == 8) { else
m_target = *reinterpret_cast<const uint64_t *>(raw.data()); # endif
} {
else { if (size == 4) {
return false; m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast<const uint32_t *>(raw.data())));
}
else if (size == 8) {
m_target = *reinterpret_cast<const uint64_t *>(raw.data());
}
else {
return false;
}
} }
# ifdef XMRIG_PROXY_PROJECT # ifdef XMRIG_PROXY_PROJECT
@@ -169,6 +177,7 @@ int32_t xmrig::Job::nonceOffset() const
auto f = algorithm().family(); auto f = algorithm().family();
if (f == Algorithm::KAWPOW) return 32; if (f == Algorithm::KAWPOW) return 32;
if (f == Algorithm::GHOSTRIDER) return 76; if (f == Algorithm::GHOSTRIDER) return 76;
if (f == Algorithm::RX_YADA) return 147;
auto id = algorithm().id(); auto id = algorithm().id();
if (id == Algorithm::ASTROBWT_DERO_2) return 44; if (id == Algorithm::ASTROBWT_DERO_2) return 44;
+2 -2
View File
@@ -30,7 +30,7 @@ namespace xmrig {
template<typename T> template<typename T>
inline T readUnaligned(const T* ptr) inline T readUnaligned(const T* ptr)
{ {
static_assert(std::is_integral<T>::value, "Integer type required"); static_assert(std::is_trivially_copyable<T>::value, "T must be trivially copyable");
T result; T result;
memcpy(&result, ptr, sizeof(T)); memcpy(&result, ptr, sizeof(T));
@@ -41,7 +41,7 @@ inline T readUnaligned(const T* ptr)
template<typename T> template<typename T>
inline void writeUnaligned(T* ptr, T data) inline void writeUnaligned(T* ptr, T data)
{ {
static_assert(std::is_integral<T>::value, "Integer type required"); static_assert(std::is_trivially_copyable<T>::value, "T must be trivially copyable");
memcpy(ptr, &data, sizeof(T)); memcpy(ptr, &data, sizeof(T));
} }
-2
View File
@@ -36,8 +36,6 @@
"max-threads-hint": 100, "max-threads-hint": 100,
"asm": true, "asm": true,
"argon2-impl": null, "argon2-impl": null,
"astrobwt-max-size": 550,
"astrobwt-avx2": false,
"cn/0": false, "cn/0": false,
"cn-lite/0": false "cn-lite/0": false
}, },
+1 -1
View File
@@ -515,7 +515,7 @@ void xmrig::Miner::setEnabled(bool enabled)
return; return;
} }
if (d_ptr->battery_power && enabled) { if (d_ptr->controller->config()->isPauseOnBattery() && d_ptr->battery_power && enabled) {
LOG_INFO("%s " YELLOW_BOLD("can't resume while on battery power"), Tags::miner()); LOG_INFO("%s " YELLOW_BOLD("can't resume while on battery power"), Tags::miner());
return; return;
+6 -12
View File
@@ -163,14 +163,6 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
return set(doc, CpuConfig::kField, CpuConfig::kAsm, arg); return set(doc, CpuConfig::kField, CpuConfig::kAsm, arg);
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
case IConfig::AstroBWTMaxSizeKey: /* --astrobwt-max-size */
return set(doc, CpuConfig::kField, CpuConfig::kAstroBWTMaxSize, static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::AstroBWTAVX2Key: /* --astrobwt-avx2 */
return set(doc, CpuConfig::kField, CpuConfig::kAstroBWTAVX2, true);
# endif
# ifdef XMRIG_ALGO_RANDOMX # ifdef XMRIG_ALGO_RANDOMX
case IConfig::RandomXInitKey: /* --randomx-init */ case IConfig::RandomXInitKey: /* --randomx-init */
return set(doc, RxConfig::kField, RxConfig::kInit, static_cast<int64_t>(strtol(arg, nullptr, 10))); return set(doc, RxConfig::kField, RxConfig::kInit, static_cast<int64_t>(strtol(arg, nullptr, 10)));
@@ -327,16 +319,18 @@ void xmrig::ConfigTransform::transformUint64(rapidjson::Document &doc, int key,
#ifdef XMRIG_FEATURE_BENCHMARK #ifdef XMRIG_FEATURE_BENCHMARK
void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int key, const char *arg) void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int key, const char *arg)
{ {
set(doc, CpuConfig::kField, CpuConfig::kHugePagesJit, true);
set(doc, CpuConfig::kField, CpuConfig::kPriority, 2);
set(doc, CpuConfig::kField, CpuConfig::kYield, false);
switch (key) { switch (key) {
case IConfig::AlgorithmKey: /* --algo */ case IConfig::AlgorithmKey: /* --algo */
return set(doc, BenchConfig::kBenchmark, BenchConfig::kAlgo, arg); return set(doc, BenchConfig::kBenchmark, BenchConfig::kAlgo, arg);
case IConfig::BenchKey: /* --bench */ case IConfig::BenchKey: /* --bench */
{
// CPU settings for the benchmark
set(doc, CpuConfig::kField, CpuConfig::kHugePagesJit, true);
set(doc, CpuConfig::kField, CpuConfig::kPriority, 2);
set(doc, CpuConfig::kField, CpuConfig::kYield, false);
return set(doc, BenchConfig::kBenchmark, BenchConfig::kSize, arg); return set(doc, BenchConfig::kBenchmark, BenchConfig::kSize, arg);
}
case IConfig::StressKey: /* --stress */ case IConfig::StressKey: /* --stress */
return add(doc, Pools::kPools, Pool::kUser, BenchConfig::kBenchmark); return add(doc, Pools::kPools, Pool::kUser, BenchConfig::kBenchmark);
-4
View File
@@ -140,10 +140,6 @@ static const option options[] = {
{ "randomx-cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey }, { "randomx-cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
{ "cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey }, { "cache-qos", 0, nullptr, IConfig::RandomXCacheQoSKey },
# endif # endif
#ifdef XMRIG_ALGO_ASTROBWT
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
{ "astrobwt-avx2", 0, nullptr, IConfig::AstroBWTAVX2Key },
#endif
# ifdef XMRIG_FEATURE_OPENCL # ifdef XMRIG_FEATURE_OPENCL
{ "opencl", 0, nullptr, IConfig::OclKey }, { "opencl", 0, nullptr, IConfig::OclKey },
{ "opencl-devices", 1, nullptr, IConfig::OclDevicesKey }, { "opencl-devices", 1, nullptr, IConfig::OclDevicesKey },
-5
View File
@@ -108,11 +108,6 @@ static inline const std::string &usage()
u += " --randomx-cache-qos enable Cache QoS\n"; u += " --randomx-cache-qos enable Cache QoS\n";
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT
u += " --astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200\n";
u += " --astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm";
# endif
# ifdef XMRIG_FEATURE_OPENCL # ifdef XMRIG_FEATURE_OPENCL
u += "\nOpenCL backend:\n"; u += "\nOpenCL backend:\n";
u += " --opencl enable OpenCL mining backend\n"; u += " --opencl enable OpenCL mining backend\n";
-360
View File
@@ -31,12 +31,6 @@
#include <limits> #include <limits>
constexpr int STAGE1_SIZE = 147253;
constexpr int ALLOCATION_SIZE = (STAGE1_SIZE + 1048576) + (128 - (STAGE1_SIZE & 63));
constexpr int COUNTING_SORT_BITS = 10;
constexpr int COUNTING_SORT_SIZE = 1 << COUNTING_SORT_BITS;
static bool astrobwtInitialized = false; static bool astrobwtInitialized = false;
#ifdef ASTROBWT_AVX2 #ifdef ASTROBWT_AVX2
@@ -87,353 +81,6 @@ static void Salsa20_XORKeyStream_AVX256(const void* key, void* output, size_t si
} }
#endif #endif
static inline bool smaller(const uint8_t* v, uint64_t a, uint64_t b)
{
const uint64_t value_a = a >> 21;
const uint64_t value_b = b >> 21;
if (value_a < value_b) {
return true;
}
if (value_a > value_b) {
return false;
}
a &= (1 << 21) - 1;
b &= (1 << 21) - 1;
if (a == b) {
return false;
}
const uint64_t data_a = bswap_64(*reinterpret_cast<const uint64_t*>(v + a + 5));
const uint64_t data_b = bswap_64(*reinterpret_cast<const uint64_t*>(v + b + 5));
return (data_a < data_b);
}
void sort_indices(uint32_t N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indices)
{
uint32_t counters[2][COUNTING_SORT_SIZE] = {};
{
#define ITER(X) \
do { \
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i + X)); \
++counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)]; \
++counters[1][k >> (64 - COUNTING_SORT_BITS)]; \
} while (0)
uint32_t i = 0;
const uint32_t n = N - 15;
for (; i < n; i += 16) {
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
}
for (; i < N; ++i) {
ITER(0);
}
#undef ITER
}
uint32_t prev[2] = { counters[0][0], counters[1][0] };
counters[0][0] = prev[0] - 1;
counters[1][0] = prev[1] - 1;
for (int i = 1; i < COUNTING_SORT_SIZE; ++i)
{
const uint32_t cur[2] = { counters[0][i] + prev[0], counters[1][i] + prev[1] };
counters[0][i] = cur[0] - 1;
counters[1][i] = cur[1] - 1;
prev[0] = cur[0];
prev[1] = cur[1];
}
{
#define ITER(X) \
do { \
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + (i - X))); \
tmp_indices[counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)]--] = (k & (static_cast<uint64_t>(-1) << 21)) | (i - X); \
} while (0)
uint32_t i = N;
for (; i >= 8; i -= 8) {
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
}
for (; i > 0; --i) {
ITER(1);
}
#undef ITER
}
{
#define ITER(X) \
do { \
const uint64_t data = tmp_indices[i - X]; \
indices[counters[1][data >> (64 - COUNTING_SORT_BITS)]--] = data; \
} while (0)
uint32_t i = N;
for (; i >= 8; i -= 8) {
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
}
for (; i > 0; --i) {
ITER(1);
}
#undef ITER
}
uint64_t prev_t = indices[0];
for (uint32_t i = 1; i < N; ++i)
{
uint64_t t = indices[i];
if (smaller(v, t, prev_t))
{
const uint64_t t2 = prev_t;
int j = i - 1;
do
{
indices[j + 1] = prev_t;
--j;
if (j < 0) {
break;
}
prev_t = indices[j];
} while (smaller(v, t, prev_t));
indices[j + 1] = t;
t = t2;
}
prev_t = t;
}
}
void sort_indices2(uint32_t N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indices)
{
alignas(16) uint32_t counters[1 << COUNTING_SORT_BITS] = {};
alignas(16) uint32_t counters2[1 << COUNTING_SORT_BITS];
{
#define ITER(X) { \
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i + X)); \
++counters[k >> (64 - COUNTING_SORT_BITS)]; \
}
uint32_t i = 0;
const uint32_t n = (N / 32) * 32;
for (; i < n; i += 32) {
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
ITER(16); ITER(17); ITER(18); ITER(19); ITER(20); ITER(21); ITER(22); ITER(23);
ITER(24); ITER(25); ITER(26); ITER(27); ITER(28); ITER(29); ITER(30); ITER(31);
}
for (; i < N; ++i) {
ITER(0);
}
#undef ITER
}
uint32_t prev = static_cast<uint32_t>(-1);
for (uint32_t i = 0; i < (1 << COUNTING_SORT_BITS); i += 16)
{
#define ITER(X) { \
const uint32_t cur = counters[i + X] + prev; \
counters[i + X] = cur; \
counters2[i + X] = cur; \
prev = cur; \
}
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
#undef ITER
}
{
#define ITER(X) \
do { \
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + (i - X))); \
indices[counters[k >> (64 - COUNTING_SORT_BITS)]--] = (k & (static_cast<uint64_t>(-1) << 21)) | (i - X); \
} while (0)
uint32_t i = N;
for (; i >= 8; i -= 8) {
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
}
for (; i > 0; --i) {
ITER(1);
}
#undef ITER
}
uint32_t prev_i = 0;
for (uint32_t i0 = 0; i0 < (1 << COUNTING_SORT_BITS); ++i0) {
const uint32_t i = counters2[i0] + 1;
const uint32_t n = i - prev_i;
if (n > 1) {
memset(counters, 0, sizeof(uint32_t) * (1 << COUNTING_SORT_BITS));
const uint32_t n8 = (n / 8) * 8;
uint32_t j = 0;
#define ITER(X) { \
const uint64_t k = indices[prev_i + j + X]; \
++counters[(k >> (64 - COUNTING_SORT_BITS * 2)) & ((1 << COUNTING_SORT_BITS) - 1)]; \
tmp_indices[j + X] = k; \
}
for (; j < n8; j += 8) {
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
}
for (; j < n; ++j) {
ITER(0);
}
#undef ITER
uint32_t prev = static_cast<uint32_t>(-1);
for (uint32_t j = 0; j < (1 << COUNTING_SORT_BITS); j += 32)
{
#define ITER(X) { \
const uint32_t cur = counters[j + X] + prev; \
counters[j + X] = cur; \
prev = cur; \
}
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
ITER(16); ITER(17); ITER(18); ITER(19); ITER(20); ITER(21); ITER(22); ITER(23);
ITER(24); ITER(25); ITER(26); ITER(27); ITER(28); ITER(29); ITER(30); ITER(31);
#undef ITER
}
#define ITER(X) { \
const uint64_t k = tmp_indices[j - X]; \
const uint32_t index = counters[(k >> (64 - COUNTING_SORT_BITS * 2)) & ((1 << COUNTING_SORT_BITS) - 1)]--; \
indices[prev_i + index] = k; \
}
for (j = n; j >= 8; j -= 8) {
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
}
for (; j > 0; --j) {
ITER(1);
}
#undef ITER
uint64_t prev_t = indices[prev_i];
for (uint64_t* p = indices + prev_i + 1, *e = indices + i; p != e; ++p)
{
uint64_t t = *p;
if (smaller(v, t, prev_t))
{
const uint64_t t2 = prev_t;
uint64_t* p1 = p;
do
{
*p1 = prev_t;
--p1;
if (p1 <= indices + prev_i) {
break;
}
prev_t = *(p1 - 1);
} while (smaller(v, t, prev_t));
*p1 = t;
t = t2;
}
prev_t = t;
}
}
prev_i = i;
}
}
bool xmrig::astrobwt::astrobwt_dero(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash, int stage2_max_size, bool avx2)
{
alignas(8) uint8_t key[32];
uint8_t* scratchpad_ptr = (uint8_t*)(scratchpad) + 64;
uint8_t* stage1_output = scratchpad_ptr;
uint8_t* stage2_output = scratchpad_ptr;
uint64_t* indices = (uint64_t*)(scratchpad_ptr + ALLOCATION_SIZE);
uint64_t* tmp_indices = (uint64_t*)(scratchpad_ptr + ALLOCATION_SIZE * 9);
uint8_t* stage1_result = (uint8_t*)(tmp_indices);
uint8_t* stage2_result = (uint8_t*)(tmp_indices);
#ifdef ASTROBWT_AVX2
if (hasAVX2 && avx2) {
SHA3_256_AVX2_ASM(input_data, input_size, key);
Salsa20_XORKeyStream_AVX256(key, stage1_output, STAGE1_SIZE);
}
else
#endif
{
sha3_HashBuffer(256, SHA3_FLAGS_NONE, input_data, input_size, key, sizeof(key));
Salsa20_XORKeyStream(key, stage1_output, STAGE1_SIZE);
}
sort_indices(STAGE1_SIZE + 1, stage1_output, indices, tmp_indices);
{
const uint8_t* tmp = stage1_output - 1;
for (int i = 0; i <= STAGE1_SIZE; ++i) {
stage1_result[i] = tmp[indices[i] & ((1 << 21) - 1)];
}
}
#ifdef ASTROBWT_AVX2
if (hasAVX2 && avx2)
SHA3_256_AVX2_ASM(stage1_result, STAGE1_SIZE + 1, key);
else
#endif
sha3_HashBuffer(256, SHA3_FLAGS_NONE, stage1_result, STAGE1_SIZE + 1, key, sizeof(key));
const int stage2_size = STAGE1_SIZE + (*(uint32_t*)(key) & 0xfffff);
if (stage2_size > stage2_max_size) {
return false;
}
#ifdef ASTROBWT_AVX2
if (hasAVX2 && avx2) {
Salsa20_XORKeyStream_AVX256(key, stage2_output, stage2_size);
}
else
#endif
{
Salsa20_XORKeyStream(key, stage2_output, stage2_size);
}
sort_indices2(stage2_size + 1, stage2_output, indices, tmp_indices);
{
const uint8_t* tmp = stage2_output - 1;
int i = 0;
const int n = ((stage2_size + 1) / 4) * 4;
for (; i < n; i += 4)
{
stage2_result[i + 0] = tmp[indices[i + 0] & ((1 << 21) - 1)];
stage2_result[i + 1] = tmp[indices[i + 1] & ((1 << 21) - 1)];
stage2_result[i + 2] = tmp[indices[i + 2] & ((1 << 21) - 1)];
stage2_result[i + 3] = tmp[indices[i + 3] & ((1 << 21) - 1)];
}
for (; i <= stage2_size; ++i) {
stage2_result[i] = tmp[indices[i] & ((1 << 21) - 1)];
}
}
#ifdef ASTROBWT_AVX2
if (hasAVX2 && avx2)
SHA3_256_AVX2_ASM(stage2_result, stage2_size + 1, output_hash);
else
#endif
sha3_HashBuffer(256, SHA3_FLAGS_NONE, stage2_result, stage2_size + 1, output_hash, 32);
return true;
}
bool xmrig::astrobwt::astrobwt_dero_v2(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash) bool xmrig::astrobwt::astrobwt_dero_v2(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash)
{ {
constexpr size_t N = 9973; constexpr size_t N = 9973;
@@ -485,13 +132,6 @@ void xmrig::astrobwt::init()
} }
template<>
void xmrig::astrobwt::single_hash<xmrig::Algorithm::ASTROBWT_DERO>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t)
{
astrobwt_dero(input, static_cast<uint32_t>(size), ctx[0]->memory, output, std::numeric_limits<int>::max(), true);
}
template<> template<>
void xmrig::astrobwt::single_hash<xmrig::Algorithm::ASTROBWT_DERO_2>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t) void xmrig::astrobwt::single_hash<xmrig::Algorithm::ASTROBWT_DERO_2>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t)
{ {
-4
View File
@@ -31,16 +31,12 @@ namespace xmrig {
namespace astrobwt { namespace astrobwt {
bool astrobwt_dero(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash, int stage2_max_size, bool avx2);
bool astrobwt_dero_v2(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash); bool astrobwt_dero_v2(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash);
void init(); void init();
template<Algorithm::Id ALGO> template<Algorithm::Id ALGO>
void single_hash(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t); void single_hash(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t);
template<>
void single_hash<Algorithm::ASTROBWT_DERO>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t);
template<> template<>
void single_hash<Algorithm::ASTROBWT_DERO_2>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t); void single_hash<Algorithm::ASTROBWT_DERO_2>(const uint8_t* input, size_t size, uint8_t* output, cryptonight_ctx** ctx, uint64_t);
-4
View File
@@ -376,10 +376,6 @@ xmrig::CnHash::CnHash()
# endif # endif
# ifdef XMRIG_ALGO_ASTROBWT # ifdef XMRIG_ALGO_ASTROBWT
m_map[Algorithm::ASTROBWT_DERO] = new cn_hash_fun_array{};
m_map[Algorithm::ASTROBWT_DERO]->data[AV_SINGLE][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO>;
m_map[Algorithm::ASTROBWT_DERO]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO>;
m_map[Algorithm::ASTROBWT_DERO_2] = new cn_hash_fun_array{}; m_map[Algorithm::ASTROBWT_DERO_2] = new cn_hash_fun_array{};
m_map[Algorithm::ASTROBWT_DERO_2]->data[AV_SINGLE][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO_2>; m_map[Algorithm::ASTROBWT_DERO_2]->data[AV_SINGLE][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO_2>;
m_map[Algorithm::ASTROBWT_DERO_2]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO_2>; m_map[Algorithm::ASTROBWT_DERO_2]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO_2>;
-14
View File
@@ -433,20 +433,6 @@ const static uint8_t argon2_wrkz_test_out[256] = {
#ifdef XMRIG_ALGO_ASTROBWT #ifdef XMRIG_ALGO_ASTROBWT
// "astrobwt"
const static uint8_t astrobwt_dero_test_out[256] = {
0x7E, 0x88, 0x44, 0xF2, 0xD6, 0xB7, 0xA4, 0x34, 0x98, 0xFE, 0x6D, 0x22, 0x65, 0x27, 0x68, 0x90,
0x23, 0xDA, 0x8A, 0x52, 0xF9, 0xFC, 0x4E, 0xC6, 0x9E, 0x5A, 0xAA, 0xA6, 0x3E, 0xDC, 0xE1, 0xC1,
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
};
// "astrobwt/v2" // "astrobwt/v2"
const static uint8_t astrobwt_dero_2_test_out[256] = { const static uint8_t astrobwt_dero_2_test_out[256] = {
0x48, 0x9E, 0xD2, 0x66, 0x14, 0x27, 0x98, 0x65, 0x03, 0xFB, 0x87, 0x25, 0xE1, 0xD3, 0x98, 0xDA, 0x48, 0x9E, 0xD2, 0x66, 0x14, 0x27, 0x98, 0x65, 0x03, 0xFB, 0x87, 0x25, 0xE1, 0xD3, 0x98, 0xDA,
+1 -2
View File
@@ -28,13 +28,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#pragma once
void randomx_set_huge_pages_jit(bool) void randomx_set_huge_pages_jit(bool)
{ {
} }
void randomx_set_optimized_dataset_init(int) void randomx_set_optimized_dataset_init(int)
{ {
} }
+13
View File
@@ -107,10 +107,20 @@ RandomX_ConfigurationKeva::RandomX_ConfigurationKeva()
ScratchpadL3_Size = 1048576; ScratchpadL3_Size = 1048576;
} }
#ifdef XMRIG_ALGO_RX_YADA
RandomX_ConfigurationYada::RandomX_ConfigurationYada()
{
ArgonSalt = "RandomXYadaCoin\x03";
SuperscalarLatency = 150;
ArgonIterations = 4;
}
#endif
RandomX_ConfigurationBase::RandomX_ConfigurationBase() RandomX_ConfigurationBase::RandomX_ConfigurationBase()
: ArgonIterations(3) : ArgonIterations(3)
, ArgonLanes(1) , ArgonLanes(1)
, ArgonSalt("RandomX\x03") , ArgonSalt("RandomX\x03")
, SuperscalarLatency(170)
, ScratchpadL1_Size(16384) , ScratchpadL1_Size(16384)
, ScratchpadL2_Size(262144) , ScratchpadL2_Size(262144)
, ScratchpadL3_Size(2097152) , ScratchpadL3_Size(2097152)
@@ -358,6 +368,9 @@ RandomX_ConfigurationArqma RandomX_ArqmaConfig;
RandomX_ConfigurationGraft RandomX_GraftConfig; RandomX_ConfigurationGraft RandomX_GraftConfig;
RandomX_ConfigurationSafex RandomX_SafexConfig; RandomX_ConfigurationSafex RandomX_SafexConfig;
RandomX_ConfigurationKeva RandomX_KevaConfig; RandomX_ConfigurationKeva RandomX_KevaConfig;
#ifdef XMRIG_ALGO_RX_YADA
RandomX_ConfigurationYada RandomX_YadaConfig;
#endif
alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig; alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig;
+7 -1
View File
@@ -69,7 +69,6 @@ struct RandomX_ConfigurationBase
{ {
ArgonMemory = 262144, ArgonMemory = 262144,
CacheAccesses = 8, CacheAccesses = 8,
SuperscalarLatency = 170,
DatasetBaseSize = 2147483648, DatasetBaseSize = 2147483648,
DatasetExtraSize = 33554368, DatasetExtraSize = 33554368,
JumpBits = 8, JumpBits = 8,
@@ -82,6 +81,7 @@ struct RandomX_ConfigurationBase
uint32_t ArgonIterations; uint32_t ArgonIterations;
uint32_t ArgonLanes; uint32_t ArgonLanes;
const char* ArgonSalt; const char* ArgonSalt;
uint32_t SuperscalarLatency;
uint32_t ScratchpadL1_Size; uint32_t ScratchpadL1_Size;
uint32_t ScratchpadL2_Size; uint32_t ScratchpadL2_Size;
@@ -147,6 +147,9 @@ struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_C
struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_ConfigurationGraft(); }; struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_ConfigurationGraft(); };
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); }; struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
struct RandomX_ConfigurationKeva : public RandomX_ConfigurationBase { RandomX_ConfigurationKeva(); }; struct RandomX_ConfigurationKeva : public RandomX_ConfigurationBase { RandomX_ConfigurationKeva(); };
#ifdef XMRIG_ALGO_RX_YADA
struct RandomX_ConfigurationYada : public RandomX_ConfigurationBase { RandomX_ConfigurationYada(); };
#endif
extern RandomX_ConfigurationMonero RandomX_MoneroConfig; extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
extern RandomX_ConfigurationWownero RandomX_WowneroConfig; extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
@@ -154,6 +157,9 @@ extern RandomX_ConfigurationArqma RandomX_ArqmaConfig;
extern RandomX_ConfigurationGraft RandomX_GraftConfig; extern RandomX_ConfigurationGraft RandomX_GraftConfig;
extern RandomX_ConfigurationSafex RandomX_SafexConfig; extern RandomX_ConfigurationSafex RandomX_SafexConfig;
extern RandomX_ConfigurationKeva RandomX_KevaConfig; extern RandomX_ConfigurationKeva RandomX_KevaConfig;
#ifdef XMRIG_ALGO_RX_YADA
extern RandomX_ConfigurationYada RandomX_YadaConfig;
#endif
extern RandomX_ConfigurationBase RandomX_CurrentConfig; extern RandomX_ConfigurationBase RandomX_CurrentConfig;
+5
View File
@@ -47,6 +47,11 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm)
case Algorithm::RX_KEVA: case Algorithm::RX_KEVA:
return &RandomX_KevaConfig; return &RandomX_KevaConfig;
# ifdef XMRIG_ALGO_RX_YADA
case Algorithm::RX_YADA:
return &RandomX_YadaConfig;
# endif
default: default:
break; break;
} }
+3 -2
View File
@@ -24,6 +24,7 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include "base/tools/Alignment.h"
namespace xmrig { namespace xmrig {
@@ -45,10 +46,10 @@ struct u64 {
template<typename T> template<typename T>
inline T dmi_get(const uint8_t *data) { return *reinterpret_cast<const T *>(data); } inline T dmi_get(const uint8_t *data) { return readUnaligned(reinterpret_cast<const T *>(data)); }
template<typename T> template<typename T>
inline T dmi_get(const dmi_header *h, size_t offset) { return *reinterpret_cast<const T *>(h->data + offset); } inline T dmi_get(const dmi_header *h, size_t offset) { return readUnaligned(reinterpret_cast<const T *>(h->data + offset)); }
const char *dmi_string(dmi_header *dm, size_t offset); const char *dmi_string(dmi_header *dm, size_t offset);
+2 -2
View File
@@ -22,14 +22,14 @@
#define APP_ID "xmrig" #define APP_ID "xmrig"
#define APP_NAME "XMRig" #define APP_NAME "XMRig"
#define APP_DESC "XMRig miner" #define APP_DESC "XMRig miner"
#define APP_VERSION "6.17.0" #define APP_VERSION "6.18.0-dev"
#define APP_DOMAIN "xmrig.com" #define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com" #define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2022 xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2022 xmrig.com"
#define APP_KIND "miner" #define APP_KIND "miner"
#define APP_VER_MAJOR 6 #define APP_VER_MAJOR 6
#define APP_VER_MINOR 17 #define APP_VER_MINOR 18
#define APP_VER_PATCH 0 #define APP_VER_PATCH 0
#ifdef _MSC_VER #ifdef _MSC_VER