Added command line option --astrobwt-avx2

This commit is contained in:
XMRig 2020-03-12 00:04:07 +07:00
parent 1986b45acd
commit 92a258f142
No known key found for this signature in database
GPG key ID: 446A53638BE94409
11 changed files with 16 additions and 9 deletions

View file

@ -68,6 +68,7 @@ CPU backend:
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
--randomx-no-rdmsr disable reverting initial MSR values on exit
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
--astrobwt-avx2 enable AVX2 optimizations for AstroBWT algorithm
API:
--api-worker-id=ID custom worker-id for API

View file

@ -52,7 +52,7 @@ static const char *kArgon2Impl = "argon2-impl";
#ifdef XMRIG_ALGO_ASTROBWT
static const char* kAstroBWTMaxSize = "astrobwt-max-size";
static const char* kAstroBWTAVX2 = "astrobwt-avx2";
static const char* kAstroBWTAVX2 = "astrobwt-avx2";
#endif
@ -94,8 +94,8 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
# endif
# ifdef XMRIG_ALGO_ASTROBWT
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
obj.AddMember(StringRef(kAstroBWTAVX2), m_astrobwtAVX2, allocator);
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
obj.AddMember(StringRef(kAstroBWTAVX2), m_astrobwtAVX2, allocator);
# endif
m_threads.toJSON(obj, doc);

View file

@ -73,12 +73,12 @@ private:
AesMode m_aes = AES_AUTO;
Assembly m_assembly;
bool m_astrobwtAVX2 = false;
bool m_enabled = true;
bool m_hugePages = true;
bool m_shouldSave = false;
bool m_yield = true;
int m_astrobwtMaxSize = 550;
bool m_astrobwtAVX2 = false;
int m_memoryPool = 0;
int m_priority = -1;
String m_argon2Impl;

View file

@ -35,11 +35,11 @@
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread) :
algorithm(algorithm),
assembly(config.assembly()),
astrobwtAVX2(config.astrobwtAVX2()),
hugePages(config.isHugePages()),
hwAES(config.isHwAES()),
yield(config.isYield()),
astrobwtMaxSize(config.astrobwtMaxSize()),
astrobwtAVX2(config.astrobwtAVX2()),
astrobwtMaxSize(config.astrobwtMaxSize()),
priority(config.priority()),
affinity(thread.affinity()),
miner(miner),

View file

@ -58,11 +58,11 @@ public:
const Algorithm algorithm;
const Assembly assembly;
const bool astrobwtAVX2;
const bool hugePages;
const bool hwAES;
const bool yield;
const int astrobwtMaxSize;
const bool astrobwtAVX2;
const int priority;
const int64_t affinity;
const Miner *miner;

View file

@ -77,11 +77,11 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
Worker(id, data.affinity, data.priority),
m_algorithm(data.algorithm),
m_assembly(data.assembly),
m_astrobwtAVX2(data.astrobwtAVX2),
m_hwAES(data.hwAES),
m_yield(data.yield),
m_av(data.av()),
m_astrobwtMaxSize(data.astrobwtMaxSize * 1000),
m_astrobwtAVX2(data.astrobwtAVX2),
m_miner(data.miner),
m_ctx()
{

View file

@ -70,11 +70,11 @@ private:
const Algorithm m_algorithm;
const Assembly m_assembly;
const bool m_astrobwtAVX2;
const bool m_hwAES;
const bool m_yield;
const CnHash::AlgoVariant m_av;
const int m_astrobwtMaxSize;
const bool m_astrobwtAVX2;
const Miner *m_miner;
cryptonight_ctx *m_ctx[N];
uint8_t m_hash[N * 32]{ 0 };

View file

@ -98,6 +98,7 @@ public:
MemoryPoolKey = 1027,
YieldKey = 1030,
AstroBWTMaxSizeKey = 1034,
AstroBWTAVX2Key = 1036,
// xmrig amd
OclPlatformKey = 1400,

View file

@ -159,6 +159,9 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
# ifdef XMRIG_ALGO_ASTROBWT
case IConfig::AstroBWTMaxSizeKey: /* --astrobwt-max-size */
return set(doc, kCpu, "astrobwt-max-size", static_cast<uint64_t>(strtol(arg, nullptr, 10)));
case IConfig::AstroBWTAVX2Key: /* --astrobwt-avx2 */
return set(doc, kCpu, "astrobwt-avx2", true);
# endif
# ifdef XMRIG_ALGO_RANDOMX

View file

@ -110,6 +110,7 @@ static const option options[] = {
# endif
#ifdef XMRIG_ALGO_ASTROBWT
{ "astrobwt-max-size", 1, nullptr, IConfig::AstroBWTMaxSizeKey },
{ "astrobwt-avx2", 0, nullptr, IConfig::AstroBWTAVX2Key },
#endif
# ifdef XMRIG_FEATURE_OPENCL
{ "opencl", 0, nullptr, IConfig::OclKey },

View file

@ -96,6 +96,7 @@ static inline const std::string &usage()
# 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_HTTP