Added support for multi-algorithm CPU threads settings.

This commit is contained in:
XMRig 2019-07-02 22:56:28 +07:00
parent 83fdbbf29c
commit b92807e8d8
24 changed files with 595 additions and 109 deletions

145
src/backend/Threads.cpp Normal file
View file

@ -0,0 +1,145 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* 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-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "backend/cpu/CpuThread.h"
#include "backend/Threads.h"
#include "rapidjson/document.h"
template <class T>
const std::vector<T> &xmrig::Threads<T>::get(const String &profileName) const
{
static std::vector<T> empty;
if (profileName.isNull() || !has(profileName)) {
return empty;
}
return m_profiles.at(profileName);
}
template <class T>
xmrig::String xmrig::Threads<T>::profileName(const Algorithm &algorithm, bool strict) const
{
if (isDisabled(algorithm)) {
return String();
}
const String name = algorithm.shortName();
if (has(name)) {
return name;
}
if (m_aliases.count(algorithm) > 0) {
return m_aliases.at(algorithm);
}
if (!strict && name.contains("/")) {
const String base = name.split('/').at(0);
if (has(base)) {
return base;
}
}
return String();
}
template <class T>
void xmrig::Threads<T>::read(const rapidjson::Value &value)
{
using namespace rapidjson;
for (auto &member : value.GetObject()) {
if (member.value.IsArray()) {
std::vector<T> threads;
for (auto &v : member.value.GetArray()) {
T thread(v);
if (thread.isValid()) {
threads.push_back(std::move(thread));
}
}
if (!threads.empty()) {
move(member.name.GetString(), std::move(threads));
}
continue;
}
const Algorithm algo(member.name.GetString());
if (!algo.isValid()) {
continue;
}
if (member.value.IsBool() && member.value.IsFalse()) {
disable(algo);
continue;
}
if (member.value.IsString()) {
if (has(member.value.GetString())) {
m_aliases.insert({ algo, member.value.GetString() });
}
else {
m_disabled.insert(algo);
}
}
}
}
template <class T>
void xmrig::Threads<T>::toJSON(rapidjson::Value &out, rapidjson::Document &doc) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
for (const auto &kv : m_profiles) {
Value arr(kArrayType);
for (const T &thread : kv.second) {
arr.PushBack(thread.toJSON(doc), allocator);
}
out.AddMember(kv.first.toJSON(), arr, allocator);
}
for (const Algorithm &algo : m_disabled) {
out.AddMember(StringRef(algo.shortName()), false, allocator);
}
for (const auto &kv : m_aliases) {
out.AddMember(StringRef(kv.first.shortName()), kv.second.toJSON(), allocator);
}
}
namespace xmrig {
template class Threads<CpuThread>;
} // namespace xmrig

67
src/backend/Threads.h Normal file
View file

@ -0,0 +1,67 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* 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-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_THREADS_H
#define XMRIG_THREADS_H
#include <map>
#include <set>
#include "base/tools/String.h"
#include "crypto/common/Algorithm.h"
#include "rapidjson/fwd.h"
namespace xmrig {
template <class T>
class Threads
{
public:
inline bool has(const char *profile) const { return m_profiles.count(profile) > 0; }
inline bool isDisabled(const Algorithm &algo) const { return m_disabled.count(algo) > 0; }
inline bool isExist(const Algorithm &algo) const { return isDisabled(algo) || m_aliases.count(algo) > 0 || has(algo.shortName()); }
inline const std::vector<T> &get(const Algorithm &algo, bool strict = false) const { return get(profileName(algo, strict)); }
inline void disable(const Algorithm &algo) { m_disabled.insert(algo); }
inline void move(const char *profile, std::vector<T> &&threads) { m_profiles.insert({ profile, threads }); }
const std::vector<T> &get(const String &profileName) const;
String profileName(const Algorithm &algorithm, bool strict = false) const;
void read(const rapidjson::Value &value);
void toJSON(rapidjson::Value &out, rapidjson::Document &doc) const;
private:
std::map<Algorithm, String> m_aliases;
std::map<String, std::vector<T> > m_profiles;
std::set<Algorithm> m_disabled;
};
} /* namespace xmrig */
#endif /* XMRIG_THREADS_H */

12
src/backend/backend.cmake Normal file
View file

@ -0,0 +1,12 @@
include (src/backend/cpu/cpu.cmake)
set(HEADERS_BACKEND
"${HEADERS_CPU}"
src/backend/Threads.h
)
set(SOURCES_BACKEND
"${SOURCES_CPU}"
src/backend/Threads.cpp
)

View file

@ -31,17 +31,34 @@
namespace xmrig {
static const char *kCn = "cn";
static const char *kEnabled = "enabled";
static const char *kHugePages = "huge-pages";
static const char *kHwAes = "hw-aes";
static const char *kPriority = "priority";
#ifdef XMRIG_FEATURE_ASM
static const char *kAsm = "asm";
#endif
#ifdef XMRIG_ALGO_CN_GPU
static const char *kCnGPU = "cn/gpu";
#endif
#ifdef XMRIG_ALGO_CN_LITE
static const char *kCnLite = "cn-lite";
#endif
#ifdef XMRIG_ALGO_CN_HEAVY
static const char *kCnHeavy = "cn-heavy";
#endif
#ifdef XMRIG_ALGO_CN_PICO
static const char *kCnPico = "cn-pico";
#endif
extern template class Threads<CpuThread>;
}
@ -59,7 +76,6 @@ bool xmrig::CpuConfig::isHwAES() const
rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
Value obj(kObjectType);
@ -73,6 +89,8 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kAsm), m_assembly.toJSON(), allocator);
# endif
m_threads.toJSON(obj, doc);
return obj;
}
@ -89,6 +107,34 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
# ifdef XMRIG_FEATURE_ASM
m_assembly = Json::getValue(value, kAsm);
# endif
m_threads.read(value);
}
else if (value.IsBool() && value.IsFalse()) {
m_enabled = false;
}
else {
m_shouldSave = true;
m_threads.disable(Algorithm::CN_0);
m_threads.move(kCn, Cpu::info()->threads(Algorithm::CN_0));
# ifdef XMRIG_ALGO_CN_GPU
m_threads.move(kCnGPU, Cpu::info()->threads(Algorithm::CN_GPU));
# endif
# ifdef XMRIG_ALGO_CN_LITE
m_threads.disable(Algorithm::CN_LITE_0);
m_threads.move(kCnLite, Cpu::info()->threads(Algorithm::CN_LITE_1));
# endif
# ifdef XMRIG_ALGO_CN_HEAVY
m_threads.move(kCnHeavy, Cpu::info()->threads(Algorithm::CN_HEAVY_0));
# endif
# ifdef XMRIG_ALGO_CN_PICO
m_threads.move(kCnPico, Cpu::info()->threads(Algorithm::CN_PICO_0));
# endif
}
}

View file

@ -26,6 +26,8 @@
#define XMRIG_CPUCONFIG_H
#include "backend/cpu/CpuThread.h"
#include "backend/Threads.h"
#include "crypto/common/Assembly.h"
@ -47,11 +49,12 @@ public:
rapidjson::Value toJSON(rapidjson::Document &doc) const;
void read(const rapidjson::Value &value);
inline bool isEnabled() const { return m_enabled; }
inline bool isHugePages() const { return m_hugePages; }
inline bool isShouldSave() const { return m_shouldSave; }
inline const Assembly &assembly() const { return m_assembly; }
inline int priority() const { return m_priority; }
inline bool isEnabled() const { return m_enabled; }
inline bool isHugePages() const { return m_hugePages; }
inline bool isShouldSave() const { return m_shouldSave; }
inline const Assembly &assembly() const { return m_assembly; }
inline const Threads<CpuThread> &threads() const { return m_threads; }
inline int priority() const { return m_priority; }
private:
void setAesMode(const rapidjson::Value &aesMode);
@ -63,6 +66,7 @@ private:
bool m_hugePages = true;
bool m_shouldSave = false;
int m_priority = -1;
Threads<CpuThread> m_threads;
};

View file

@ -0,0 +1,71 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* 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-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "backend/cpu/CpuThread.h"
#include "base/io/json/Json.h"
#include "rapidjson/document.h"
namespace xmrig {
static const char *kAffinity = "affinity";
static const char *kIntensity = "intensity";
}
xmrig::CpuThread::CpuThread(const rapidjson::Value &value)
{
if (value.IsObject()) {
m_intensity = Json::getInt(value, kIntensity, -1);
m_affinity = Json::getInt(value, kAffinity, -1);
}
else if (value.IsInt()) {
m_intensity = 1;
m_affinity = value.GetInt();
}
}
rapidjson::Value xmrig::CpuThread::toJSON(rapidjson::Document &doc) const
{
using namespace rapidjson;
if (intensity() > 1) {
auto &allocator = doc.GetAllocator();
Value obj(kObjectType);
obj.AddMember(StringRef(kIntensity), m_intensity, allocator);
obj.AddMember(StringRef(kAffinity), m_affinity, allocator);
return obj;
}
return Value(m_affinity);
}

View file

@ -0,0 +1,63 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* 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-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_CPUTHREADCONFIG_H
#define XMRIG_CPUTHREADCONFIG_H
#include <vector>
#include "rapidjson/fwd.h"
namespace xmrig {
class CpuThread
{
public:
inline constexpr CpuThread(int intensity = 1, int affinity = -1) : m_affinity(affinity), m_intensity(intensity) {}
CpuThread(const rapidjson::Value &value);
inline bool isValid() const { return m_intensity >= 1 && m_intensity <= 5; }
inline int affinity() const { return m_affinity; }
inline int intensity() const { return m_intensity; }
rapidjson::Value toJSON(rapidjson::Document &doc) const;
private:
int m_affinity = -1;
int m_intensity = -1;
};
typedef std::vector<CpuThread> CpuThreads;
} /* namespace xmrig */
#endif /* XMRIG_CPUTHREADCONFIG_H */

View file

@ -1,12 +1,14 @@
set(HEADERS_CPU
src/backend/cpu/Cpu.h
src/backend/cpu/CpuConfig.h
src/backend/cpu/interfaces/ICpuInfo.h
src/backend/cpu/Cpu.h
src/backend/cpu/CpuConfig.h
src/backend/cpu/CpuThread.h
src/backend/cpu/interfaces/ICpuInfo.h
)
set(SOURCES_CPU
src/backend/cpu/Cpu.cpp
src/backend/cpu/CpuConfig.cpp
src/backend/cpu/CpuThread.cpp
)

View file

@ -26,11 +26,9 @@
#define XMRIG_CPUINFO_H
#include <stddef.h>
#include <stdint.h>
#include "backend/cpu/CpuThread.h"
#include "crypto/common/Assembly.h"
#include "crypto/common/Algorithm.h"
namespace xmrig {
@ -47,18 +45,19 @@ public:
inline constexpr static bool isX64() { return false; }
# endif
virtual Assembly::Id assembly() const = 0;
virtual bool hasAES() const = 0;
virtual bool hasAVX2() const = 0;
virtual bool isSupported() const = 0;
virtual const char *brand() const = 0;
virtual int32_t cores() const = 0;
virtual int32_t L2() const = 0;
virtual int32_t L3() const = 0;
virtual int32_t nodes() const = 0;
virtual int32_t sockets() const = 0;
virtual int32_t threads() const = 0;
virtual CpuThreads threads(const Algorithm &algorithm) const = 0;
virtual size_t cores() const = 0;
virtual size_t L2() const = 0;
virtual size_t L3() const = 0;
virtual size_t nodes() const = 0;
virtual size_t optimalThreadsCount(size_t memSize, int maxCpuUsage) const = 0;
virtual Assembly::Id assembly() const = 0;
virtual size_t sockets() const = 0;
virtual size_t threads() const = 0;
};

View file

@ -26,51 +26,43 @@
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "backend/cpu/platform/AdvancedCpuInfo.h"
xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
m_aes(false),
m_avx2(false),
m_L2_exclusive(false),
m_brand(),
m_cores(0),
m_L2(0),
m_L3(0),
m_sockets(1),
m_threads(0)
m_brand()
{
struct cpu_raw_data_t raw = { 0 };
struct cpu_id_t data = { 0 };
struct cpu_raw_data_t raw = {};
struct cpu_id_t data = {};
cpuid_get_raw_data(&raw);
cpu_identify(&raw, &data);
strncpy(m_brand, data.brand_str, sizeof(m_brand));
m_threads = data.total_logical_cpus;
m_sockets = threads() / data.num_logical_cpus;
if (m_sockets == 0) {
m_sockets = 1;
}
m_threads = static_cast<size_t>(data.total_logical_cpus);
m_sockets = std::max<size_t>(threads() / static_cast<size_t>(data.num_logical_cpus), 1);
m_cores = static_cast<size_t>(data.num_cores) * m_sockets;
m_L3 = data.l3_cache > 0 ? static_cast<size_t>(data.l3_cache) * m_sockets : 0;
m_cores = data.num_cores * m_sockets;
m_L3 = data.l3_cache > 0 ? data.l3_cache * m_sockets : 0;
const size_t l2 = static_cast<size_t>(data.l2_cache);
// Workaround for AMD CPUs https://github.com/anrieff/libcpuid/issues/97
if (data.vendor == VENDOR_AMD && data.ext_family >= 0x15 && data.ext_family < 0x17) {
m_L2 = data.l2_cache * (cores() / 2) * m_sockets;
m_L2 = l2 * (cores() / 2) * m_sockets;
m_L2_exclusive = true;
}
// Workaround for Intel Pentium Dual-Core, Core Duo, Core 2 Duo, Core 2 Quad and their Xeon homologue
// These processors have L2 cache shared by 2 cores.
else if (data.vendor == VENDOR_INTEL && data.ext_family == 0x06 && (data.ext_model == 0x0E || data.ext_model == 0x0F || data.ext_model == 0x17)) {
int l2_count_per_socket = cores() > 1 ? cores() / 2 : 1;
m_L2 = data.l2_cache > 0 ? data.l2_cache * l2_count_per_socket * m_sockets : 0;
size_t l2_count_per_socket = cores() > 1 ? cores() / 2 : 1;
m_L2 = data.l2_cache > 0 ? l2 * l2_count_per_socket * m_sockets : 0;
}
else{
m_L2 = data.l2_cache > 0 ? data.l2_cache * cores() * m_sockets : 0;
m_L2 = data.l2_cache > 0 ? l2 * cores() * m_sockets : 0;
}
if (data.flags[CPU_FEATURE_AES]) {
@ -125,3 +117,43 @@ size_t xmrig::AdvancedCpuInfo::optimalThreadsCount(size_t memSize, int maxCpuUsa
return count < 1 ? 1 : count;
}
xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm) const
{
if (threads() == 1) {
return CpuThreads(1);
}
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return CpuThreads(threads());
}
# endif
size_t cache = 0;
size_t count = 0;
if (m_L3) {
cache = m_L2_exclusive ? (m_L2 + m_L3) : m_L3;
}
else {
cache = m_L2;
}
if (cache) {
cache *= 1024;
const size_t memory = algorithm.memory();
count = cache / memory;
if (cache % memory >= memory / 2) {
count++;
}
}
else {
count = threads() / 2;
}
return CpuThreads(std::max<size_t>(std::min<size_t>(count, threads()), 1));
}

View file

@ -39,30 +39,31 @@ public:
protected:
size_t optimalThreadsCount(size_t memSize, int maxCpuUsage) const override;
CpuThreads threads(const Algorithm &algorithm) const override;
inline Assembly::Id 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; }
inline int32_t L2() const override { return m_L2; }
inline int32_t L3() const override { return m_L3; }
inline int32_t nodes() const override { return -1; }
inline int32_t sockets() const override { return m_sockets; }
inline int32_t threads() const override { return m_threads; }
inline size_t cores() const override { return m_cores; }
inline size_t L2() const override { return m_L2; }
inline size_t L3() const override { return m_L3; }
inline size_t nodes() const override { return 0; }
inline size_t sockets() const override { return m_sockets; }
inline size_t threads() const override { return m_threads; }
private:
Assembly m_assembly;
bool m_aes;
bool m_avx2;
bool m_L2_exclusive;
bool m_aes = false;
bool m_avx2 = false;
bool m_L2_exclusive = false;
char m_brand[64];
int32_t m_cores;
int32_t m_L2;
int32_t m_L3;
int32_t m_sockets;
int32_t m_threads;
size_t m_cores = 0;
size_t m_L2 = 0;
size_t m_L3 = 0;
size_t m_sockets = 1;
size_t m_threads = 0;
};

View file

@ -22,6 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <string.h>
#include <thread>
@ -123,9 +124,9 @@ static inline bool has_ossave()
xmrig::BasicCpuInfo::BasicCpuInfo() :
m_assembly(Assembly::NONE),
m_brand(),
m_aes(has_aes_ni()),
m_avx2(has_avx2() && has_ossave()),
m_brand(),
m_threads(std::thread::hardware_concurrency())
{
cpu_brand_string(m_brand);
@ -158,3 +159,27 @@ size_t xmrig::BasicCpuInfo::optimalThreadsCount(size_t memSize, int maxCpuUsage)
return count < 1 ? 1 : count;
}
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm) const
{
if (threads() == 1) {
return CpuThreads(1);
}
# ifdef XMRIG_ALGO_CN_GPU
if (algorithm == Algorithm::CN_GPU) {
return CpuThreads(threads());
}
# endif
if (algorithm.family() == Algorithm::CN_LITE || algorithm.family() == Algorithm::CN_PICO) {
return CpuThreads(threads());
}
if (algorithm.family() == Algorithm::CN_HEAVY) {
return CpuThreads(std::max<size_t>(threads() / 4, 1));
}
return CpuThreads(std::max<size_t>(threads() / 2, 1));
}

View file

@ -39,25 +39,26 @@ public:
protected:
size_t optimalThreadsCount(size_t memSize, int maxCpuUsage) const override;
CpuThreads threads(const Algorithm &algorithm) const override;
inline Assembly::Id 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 -1; }
inline int32_t L2() const override { return -1; }
inline int32_t L3() const override { return -1; }
inline int32_t nodes() const override { return -1; }
inline int32_t sockets() const override { return 1; }
inline int32_t threads() const override { return m_threads; }
inline size_t cores() const override { return 0; }
inline size_t L2() const override { return 0; }
inline size_t L3() const override { return 0; }
inline size_t nodes() const override { return 0; }
inline size_t sockets() const override { return 1; }
inline size_t threads() const override { return m_threads; }
private:
Assembly m_assembly;
bool m_aes;
bool m_avx2;
char m_brand[64];
int32_t m_threads;
char m_brand[64 + 6];
const bool m_aes;
const bool m_avx2;
const size_t m_threads;
};