AstroBWT algorithm (DERO) support
To test: - Download https://github.com/deroproject/derosuite/releases/tag/AstroBWT - Run daemon with `--testnet` in command line In config.json: - "coin":"dero" - "url":"127.0.0.1:30306" - "daemon:"true"
This commit is contained in:
parent
2cd45a9e38
commit
14ef99ca67
29 changed files with 2316 additions and 11 deletions
|
@ -165,6 +165,7 @@ void xmrig::CpuConfig::generate()
|
|||
count += xmrig::generate<Algorithm::CN_PICO>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
|
||||
|
||||
m_shouldSave = count > 0;
|
||||
}
|
||||
|
|
|
@ -143,6 +143,14 @@ size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
template<>
|
||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32_t limit)
|
||||
{
|
||||
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,11 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
# include "crypto/astrobwt/AstroBWT.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static constexpr uint32_t kReserveCount = 32768;
|
||||
|
@ -180,6 +185,12 @@ bool xmrig::CpuWorker<N>::selfTest()
|
|||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (m_algorithm.family() == Algorithm::ASTROBWT) {
|
||||
return verify(Algorithm::ASTROBWT_DERO, astrobwt_dero_test_out);
|
||||
}
|
||||
# endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,17 @@ xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm, ui
|
|||
size_t cache = 0;
|
||||
size_t count = 0;
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
||||
CpuThreads t;
|
||||
count = threads();
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
t.add(i, 0);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
# endif
|
||||
|
||||
if (m_L3) {
|
||||
cache = m_L2_exclusive ? (m_L2 + m_L3) : m_L3;
|
||||
}
|
||||
|
|
|
@ -258,5 +258,15 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm.family() == Algorithm::ASTROBWT) {
|
||||
CpuThreads threads;
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
threads.add(i, 0);
|
||||
}
|
||||
return threads;
|
||||
}
|
||||
# endif
|
||||
|
||||
return CpuThreads(std::max<size_t>(count / 2, 1), 1);
|
||||
}
|
||||
|
|
|
@ -216,6 +216,12 @@ bool xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset)
|
|||
|
||||
xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
|
||||
{
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
# endif
|
||||
|
||||
if (L2() == 0 && L3() == 0) {
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define ALGO_RX_SFX 23
|
||||
#define ALGO_AR2_CHUKWA 24
|
||||
#define ALGO_AR2_WRKZ 25
|
||||
#define ALGO_ASTROBWT_DERO 26
|
||||
|
||||
#define FAMILY_UNKNOWN 0
|
||||
#define FAMILY_CN 1
|
||||
|
@ -32,3 +33,4 @@
|
|||
#define FAMILY_CN_PICO 4
|
||||
#define FAMILY_RANDOM_X 5
|
||||
#define FAMILY_ARGON2 6
|
||||
#define FAMILY_ASTROBWT 7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue