mirror of
https://github.com/xmrig/xmrig.git
synced 2025-03-16 16:42:14 +00:00
Merge pull request #2682 from SChernykh/dev
Fix: use cn-heavy optimization only for Vermeer CPUs
This commit is contained in:
commit
e0143a92a8
3 changed files with 11 additions and 1 deletions
|
@ -82,7 +82,8 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
||||||
{
|
{
|
||||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||||
// cn-heavy optimization for Zen3 CPUs
|
// cn-heavy optimization for Zen3 CPUs
|
||||||
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3)) {
|
const bool is_vermeer = (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3) && (Cpu::info()->model() == 0x21);
|
||||||
|
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && is_vermeer) {
|
||||||
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
||||||
if (!cn_heavyZen3Memory) {
|
if (!cn_heavyZen3Memory) {
|
||||||
// Round up number of threads to the multiple of 8
|
// Round up number of threads to the multiple of 8
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
virtual size_t packages() const = 0;
|
virtual size_t packages() const = 0;
|
||||||
virtual size_t threads() const = 0;
|
virtual size_t threads() const = 0;
|
||||||
virtual Vendor vendor() const = 0;
|
virtual Vendor vendor() const = 0;
|
||||||
|
virtual uint32_t model() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,14 @@ protected:
|
||||||
inline size_t packages() const override { return 1; }
|
inline size_t packages() const override { return 1; }
|
||||||
inline size_t threads() const override { return m_threads; }
|
inline size_t threads() const override { return m_threads; }
|
||||||
inline Vendor vendor() const override { return m_vendor; }
|
inline Vendor vendor() const override { return m_vendor; }
|
||||||
|
inline uint32_t model() const override
|
||||||
|
{
|
||||||
|
# ifndef XMRIG_ARM
|
||||||
|
return m_model;
|
||||||
|
# else
|
||||||
|
return 0;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Arch m_arch = ARCH_UNKNOWN;
|
Arch m_arch = ARCH_UNKNOWN;
|
||||||
|
|
Loading…
Reference in a new issue