mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-24 21:32:47 -05:00
xmrig v2.12.0 rebase
This commit is contained in:
@@ -130,7 +130,7 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
||||
|
||||
// save extended "threads" based on m_threads
|
||||
Value threads(kObjectType);
|
||||
for (int a = 0; a != xmrig::Algo::CRYPTONIGHT_MAX; ++ a) {
|
||||
for (int a = 0; a != xmrig::Algo::ALGO_MAX; ++ a) {
|
||||
const xmrig::Algo algo = static_cast<xmrig::Algo>(a);
|
||||
Value key(xmrig::Algorithm::perfAlgoName(xmrig::Algorithm(algo).perf_algo()), allocator);
|
||||
if (threadsMode(algo) != Simple) {
|
||||
@@ -186,7 +186,7 @@ bool xmrig::Config::finalize()
|
||||
}
|
||||
|
||||
// auto configure m_threads
|
||||
for (int a = 0; a != xmrig::Algo::CRYPTONIGHT_MAX; ++ a) {
|
||||
for (int a = 0; a != xmrig::Algo::ALGO_MAX; ++ a) {
|
||||
const xmrig::Algo algo = static_cast<xmrig::Algo>(a);
|
||||
if (!m_threads[algo].cpu.empty()) {
|
||||
m_threads[algo].mode = Advanced;
|
||||
@@ -349,7 +349,7 @@ void xmrig::Config::parseJSON(const rapidjson::Document &doc)
|
||||
parseThreadsJSON(threads, m_algorithm.algo());
|
||||
} else if (threads.IsObject()) {
|
||||
// parse new specific perf algo threads
|
||||
for (int a = 0; a != xmrig::Algo::CRYPTONIGHT_MAX; ++ a) {
|
||||
for (int a = 0; a != xmrig::Algo::ALGO_MAX; ++ a) {
|
||||
const xmrig::Algo algo = static_cast<xmrig::Algo>(a);
|
||||
const rapidjson::Value &threads2 = threads[xmrig::Algorithm::perfAlgoName(xmrig::Algorithm(algo).perf_algo())];
|
||||
if (threads2.IsArray()) {
|
||||
|
||||
@@ -141,7 +141,7 @@ private:
|
||||
int m_maxCpuUsage;
|
||||
int m_priority;
|
||||
// threads config for each algo
|
||||
Threads m_threads[xmrig::Algo::CRYPTONIGHT_MAX];
|
||||
Threads m_threads[xmrig::Algo::ALGO_MAX];
|
||||
// perf algo hashrate results
|
||||
float m_algo_perf[xmrig::PerfAlgo::PA_MAX];
|
||||
};
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -33,6 +33,7 @@
|
||||
xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
|
||||
m_assembly(ASM_NONE),
|
||||
m_aes(false),
|
||||
m_avx2(false),
|
||||
m_L2_exclusive(false),
|
||||
m_brand(),
|
||||
m_cores(0),
|
||||
@@ -83,6 +84,8 @@ xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
|
||||
m_assembly = ASM_INTEL;
|
||||
}
|
||||
}
|
||||
|
||||
m_avx2 = data.flags[CPU_FEATURE_AVX2];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,6 +42,7 @@ protected:
|
||||
|
||||
inline Assembly assembly() const override { return m_assembly; }
|
||||
inline bool hasAES() const override { return m_aes; }
|
||||
inline bool hasAVX2() const override { return m_avx2; }
|
||||
inline bool isSupported() const override { return true; }
|
||||
inline const char *brand() const override { return m_brand; }
|
||||
inline int32_t cores() const override { return m_cores; }
|
||||
@@ -59,6 +61,7 @@ protected:
|
||||
private:
|
||||
Assembly m_assembly;
|
||||
bool m_aes;
|
||||
bool m_avx2;
|
||||
bool m_L2_exclusive;
|
||||
char m_brand[64];
|
||||
int32_t m_cores;
|
||||
|
||||
Reference in New Issue
Block a user