Merge xmrig v6.14.1 into master
This commit is contained in:
commit
9d0d6ad9b6
48 changed files with 6641 additions and 6837 deletions
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -22,9 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "backend/common/Threads.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cpu/CpuThreads.h"
|
||||
|
@ -45,7 +36,6 @@ namespace xmrig {
|
|||
|
||||
|
||||
static const char *kAsterisk = "*";
|
||||
static const char *kCn2 = "cn/2";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
@ -114,7 +104,7 @@ xmrig::String xmrig::Threads<T>::profileName(const Algorithm &algorithm, bool st
|
|||
return String();
|
||||
}
|
||||
|
||||
const String name = algorithm.shortName();
|
||||
const String name = algorithm.name();
|
||||
if (has(name)) {
|
||||
return name;
|
||||
}
|
||||
|
@ -127,8 +117,8 @@ xmrig::String xmrig::Threads<T>::profileName(const Algorithm &algorithm, bool st
|
|||
return String();
|
||||
}
|
||||
|
||||
if (algorithm.family() == Algorithm::CN && CnAlgo<>::base(algorithm) == Algorithm::CN_2 && has(kCn2)) {
|
||||
return kCn2;
|
||||
if (algorithm.family() == Algorithm::CN && algorithm.base() == Algorithm::CN_2 && has(Algorithm::kCN_2)) {
|
||||
return Algorithm::kCN_2;
|
||||
}
|
||||
|
||||
if (name.contains("/")) {
|
||||
|
@ -159,11 +149,11 @@ void xmrig::Threads<T>::toJSON(rapidjson::Value &out, rapidjson::Document &doc)
|
|||
}
|
||||
|
||||
for (const Algorithm &algo : m_disabled) {
|
||||
out.AddMember(StringRef(algo.shortName()), false, allocator);
|
||||
out.AddMember(StringRef(algo.name()), false, allocator);
|
||||
}
|
||||
|
||||
for (const auto &kv : m_aliases) {
|
||||
out.AddMember(StringRef(kv.first.shortName()), kv.second.toJSON(), allocator);
|
||||
out.AddMember(StringRef(kv.first.name()), kv.second.toJSON(), allocator);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -22,6 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XMRIG_THREADS_H
|
||||
#define XMRIG_THREADS_H
|
||||
|
||||
|
@ -45,7 +40,7 @@ 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 isEmpty() const { return m_profiles.empty(); }
|
||||
inline bool isExist(const Algorithm &algo) const { return isDisabled(algo) || m_aliases.count(algo) > 0 || has(algo.shortName()); }
|
||||
inline bool isExist(const Algorithm &algo) const { return isDisabled(algo) || m_aliases.count(algo) > 0 || has(algo.name()); }
|
||||
inline const 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 setAlias(const Algorithm &algo, const char *profile) { m_aliases[algo] = profile; }
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -22,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <mutex>
|
||||
|
||||
|
||||
|
@ -297,7 +290,7 @@ const xmrig::String &xmrig::CpuBackend::type() const
|
|||
void xmrig::CpuBackend::prepare(const Job &nextJob)
|
||||
{
|
||||
# ifdef XMRIG_ALGO_ARGON2
|
||||
const xmrig::Algorithm::Family f = nextJob.algorithm().family();
|
||||
const auto f = nextJob.algorithm().family();
|
||||
if ((f == Algorithm::ARGON2) || (f == Algorithm::RANDOM_X)) {
|
||||
if (argon2::Impl::select(d_ptr->controller->config()->cpu().argon2Impl())) {
|
||||
LOG_INFO("%s use " WHITE_BOLD("argon2") " implementation " CSI "1;%dm" "%s",
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -53,7 +47,7 @@ size_t inline generate<Algorithm::CN>(Threads<CpuThreads> &threads, uint32_t lim
|
|||
{
|
||||
size_t count = 0;
|
||||
|
||||
count += generate("cn", threads, Algorithm::CN_1, limit);
|
||||
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, limit);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_0)) {
|
||||
threads.disable(Algorithm::CN_0);
|
||||
|
@ -61,7 +55,7 @@ size_t inline generate<Algorithm::CN>(Threads<CpuThreads> &threads, uint32_t lim
|
|||
}
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_GPU
|
||||
count += generate("cn/gpu", threads, Algorithm::CN_GPU, limit);
|
||||
count += generate(kCN_GPU, threads, Algorithm::CN_GPU, limit);
|
||||
# endif
|
||||
|
||||
return count;
|
||||
|
@ -74,7 +68,7 @@ size_t inline generate<Algorithm::CN_LITE>(Threads<CpuThreads> &threads, uint32_
|
|||
{
|
||||
size_t count = 0;
|
||||
|
||||
count += generate("cn-lite", threads, Algorithm::CN_LITE_1, limit);
|
||||
count += generate(Algorithm::kCN_LITE, threads, Algorithm::CN_LITE_1, limit);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_LITE_0)) {
|
||||
threads.disable(Algorithm::CN_LITE_0);
|
||||
|
@ -90,7 +84,7 @@ size_t inline generate<Algorithm::CN_LITE>(Threads<CpuThreads> &threads, uint32_
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_HEAVY>(Threads<CpuThreads> &threads, uint32_t limit)
|
||||
{
|
||||
return generate("cn-heavy", threads, Algorithm::CN_HEAVY_0, limit);
|
||||
return generate(Algorithm::kCN_HEAVY, threads, Algorithm::CN_HEAVY_0, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -99,7 +93,7 @@ size_t inline generate<Algorithm::CN_HEAVY>(Threads<CpuThreads> &threads, uint32
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_PICO>(Threads<CpuThreads> &threads, uint32_t limit)
|
||||
{
|
||||
return generate("cn-pico", threads, Algorithm::CN_PICO_0, limit);
|
||||
return generate(Algorithm::kCN_PICO, threads, Algorithm::CN_PICO_0, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -108,7 +102,7 @@ size_t inline generate<Algorithm::CN_PICO>(Threads<CpuThreads> &threads, uint32_
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_FEMTO>(Threads<CpuThreads>& threads, uint32_t limit)
|
||||
{
|
||||
return generate("cn/upx2", threads, Algorithm::CN_UPX2, limit);
|
||||
return generate(Algorithm::kCN_UPX2, threads, Algorithm::CN_UPX2, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -124,34 +118,34 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
|
|||
if (!threads.isExist(Algorithm::RX_ARQ)) {
|
||||
auto arq = cpuInfo->threads(Algorithm::RX_ARQ, limit);
|
||||
if (arq == wow) {
|
||||
threads.setAlias(Algorithm::RX_ARQ, "rx/wow");
|
||||
threads.setAlias(Algorithm::RX_ARQ, Algorithm::kRX_WOW);
|
||||
++count;
|
||||
}
|
||||
else {
|
||||
count += threads.move("rx/arq", std::move(arq));
|
||||
count += threads.move(Algorithm::kRX_ARQ, std::move(arq));
|
||||
}
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_KEVA)) {
|
||||
auto keva = cpuInfo->threads(Algorithm::RX_KEVA, limit);
|
||||
if (keva == wow) {
|
||||
threads.setAlias(Algorithm::RX_KEVA, "rx/wow");
|
||||
threads.setAlias(Algorithm::RX_KEVA, Algorithm::kRX_WOW);
|
||||
++count;
|
||||
}
|
||||
else {
|
||||
count += threads.move("rx/keva", std::move(keva));
|
||||
count += threads.move(Algorithm::kRX_KEVA, std::move(keva));
|
||||
}
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_WOW)) {
|
||||
count += threads.move("rx/wow", std::move(wow));
|
||||
count += threads.move(Algorithm::kRX_WOW, std::move(wow));
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_XLA)) {
|
||||
count += generate("panthera", threads, Algorithm::RX_XLA, limit);
|
||||
count += generate(Algorithm::kRX_XLA, threads, Algorithm::RX_XLA, limit);
|
||||
}
|
||||
|
||||
count += generate("rx", threads, Algorithm::RX_0, limit);
|
||||
count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -162,7 +156,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
|
|||
template<>
|
||||
size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t limit)
|
||||
{
|
||||
return generate("argon2", threads, Algorithm::AR2_CHUKWA_V2, limit);
|
||||
return generate(Algorithm::kAR2, threads, Algorithm::AR2_CHUKWA_V2, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -171,7 +165,7 @@ size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t
|
|||
template<>
|
||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32_t limit)
|
||||
{
|
||||
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, limit);
|
||||
return generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||
return 1;
|
||||
}
|
||||
|
||||
Algorithm::Family f = algorithm.family();
|
||||
const auto f = algorithm.family();
|
||||
|
||||
# ifdef XMRIG_ALGO_CN_LITE
|
||||
if (f == Algorithm::CN_LITE) {
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef XMRIG_HWLOC_DEBUG
|
||||
# include <uv.h>
|
||||
#endif
|
||||
|
@ -259,7 +258,7 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||
}
|
||||
|
||||
if (threads.isEmpty()) {
|
||||
LOG_WARN("hwloc auto configuration for algorithm \"%s\" failed.", algorithm.shortName());
|
||||
LOG_WARN("hwloc auto configuration for algorithm \"%s\" failed.", algorithm.name());
|
||||
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
|
@ -336,7 +335,7 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
|||
|
||||
size_t cacheHashes = ((L3 + extra) + (scratchpad / 2)) / scratchpad;
|
||||
|
||||
Algorithm::Family family = algorithm.family();
|
||||
const auto family = algorithm.family();
|
||||
if (intensity && ((family == Algorithm::CN_PICO) || (family == Algorithm::CN_FEMTO)) && (cacheHashes / PUs) >= 2) {
|
||||
intensity = 2;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -56,8 +50,8 @@ size_t inline generate<Algorithm::CN>(Threads<CudaThreads> &threads, const std::
|
|||
{
|
||||
size_t count = 0;
|
||||
|
||||
count += generate("cn", threads, Algorithm::CN_1, devices);
|
||||
count += generate("cn/2", threads, Algorithm::CN_2, devices);
|
||||
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, devices);
|
||||
count += generate(Algorithm::kCN_2, threads, Algorithm::CN_2, devices);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_0)) {
|
||||
threads.disable(Algorithm::CN_0);
|
||||
|
@ -76,7 +70,7 @@ size_t inline generate<Algorithm::CN>(Threads<CudaThreads> &threads, const std::
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_LITE>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||
{
|
||||
size_t count = generate("cn-lite", threads, Algorithm::CN_LITE_1, devices);
|
||||
size_t count = generate(Algorithm::kCN_LITE, threads, Algorithm::CN_LITE_1, devices);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_LITE_0)) {
|
||||
threads.disable(Algorithm::CN_LITE_0);
|
||||
|
@ -92,7 +86,7 @@ size_t inline generate<Algorithm::CN_LITE>(Threads<CudaThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_HEAVY>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||
{
|
||||
return generate("cn-heavy", threads, Algorithm::CN_HEAVY_0, devices);
|
||||
return generate(Algorithm::kCN_HEAVY, threads, Algorithm::CN_HEAVY_0, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -101,7 +95,7 @@ size_t inline generate<Algorithm::CN_HEAVY>(Threads<CudaThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_PICO>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||
{
|
||||
return generate("cn-pico", threads, Algorithm::CN_PICO_0, devices);
|
||||
return generate(Algorithm::kCN_PICO, threads, Algorithm::CN_PICO_0, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -110,7 +104,7 @@ size_t inline generate<Algorithm::CN_PICO>(Threads<CudaThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_FEMTO>(Threads<CudaThreads>& threads, const std::vector<CudaDevice>& devices)
|
||||
{
|
||||
return generate("cn/upx2", threads, Algorithm::CN_UPX2, devices);
|
||||
return generate(Algorithm::kCN_UPX2, threads, Algorithm::CN_UPX2, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -127,18 +121,18 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
|||
auto kva = CudaThreads(devices, Algorithm::RX_KEVA);
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
|
||||
count += threads.move("rx/wow", std::move(wow));
|
||||
count += threads.move(Algorithm::kRX_WOW, std::move(wow));
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_ARQ) && arq != rx) {
|
||||
count += threads.move("rx/arq", std::move(arq));
|
||||
count += threads.move(Algorithm::kRX_ARQ, std::move(arq));
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_KEVA) && kva != rx) {
|
||||
count += threads.move("rx/keva", std::move(kva));
|
||||
count += threads.move(Algorithm::kRX_KEVA, std::move(kva));
|
||||
}
|
||||
|
||||
count += threads.move("rx", std::move(rx));
|
||||
count += threads.move(Algorithm::kRX, std::move(rx));
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -149,7 +143,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||
{
|
||||
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, devices);
|
||||
return generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -158,7 +152,7 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<CudaThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::KAWPOW>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||
{
|
||||
return generate("kawpow", threads, Algorithm::KAWPOW_RVN, devices);
|
||||
return generate(Algorithm::kKAWPOW, threads, Algorithm::KAWPOW_RVN, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -22,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdexcept>
|
||||
#include <uv.h>
|
||||
|
||||
|
@ -199,7 +192,7 @@ bool xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads,
|
|||
{
|
||||
const Algorithm algo = RxAlgo::id(algorithm);
|
||||
|
||||
return pDeviceInfo_v2(ctx, blocks, threads, algo.isValid() ? algo.shortName() : nullptr, dataset_host);
|
||||
return pDeviceInfo_v2(ctx, blocks, threads, algo.isValid() ? algo.name() : nullptr, dataset_host);
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,7 +236,7 @@ bool xmrig::CudaLib::setJob(nvid_ctx *ctx, const void *data, size_t size, const
|
|||
{
|
||||
const Algorithm algo = RxAlgo::id(algorithm);
|
||||
|
||||
return pSetJob_v2(ctx, data, size, algo.shortName());
|
||||
return pSetJob_v2(ctx, data, size, algo.name());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -55,8 +49,8 @@ size_t inline generate<Algorithm::CN>(Threads<OclThreads> &threads, const std::v
|
|||
{
|
||||
size_t count = 0;
|
||||
|
||||
count += generate("cn", threads, Algorithm::CN_1, devices);
|
||||
count += generate("cn/2", threads, Algorithm::CN_2, devices);
|
||||
count += generate(Algorithm::kCN, threads, Algorithm::CN_1, devices);
|
||||
count += generate(Algorithm::kCN_2, threads, Algorithm::CN_2, devices);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_0)) {
|
||||
threads.disable(Algorithm::CN_0);
|
||||
|
@ -75,7 +69,7 @@ size_t inline generate<Algorithm::CN>(Threads<OclThreads> &threads, const std::v
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_LITE>(Threads<OclThreads> &threads, const std::vector<OclDevice> &devices)
|
||||
{
|
||||
size_t count = generate("cn-lite", threads, Algorithm::CN_LITE_1, devices);
|
||||
size_t count = generate(Algorithm::kCN_LITE, threads, Algorithm::CN_LITE_1, devices);
|
||||
|
||||
if (!threads.isExist(Algorithm::CN_LITE_0)) {
|
||||
threads.disable(Algorithm::CN_LITE_0);
|
||||
|
@ -91,7 +85,7 @@ size_t inline generate<Algorithm::CN_LITE>(Threads<OclThreads> &threads, const s
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_HEAVY>(Threads<OclThreads> &threads, const std::vector<OclDevice> &devices)
|
||||
{
|
||||
return generate("cn-heavy", threads, Algorithm::CN_HEAVY_0, devices);
|
||||
return generate(Algorithm::kCN_HEAVY, threads, Algorithm::CN_HEAVY_0, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -100,7 +94,7 @@ size_t inline generate<Algorithm::CN_HEAVY>(Threads<OclThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_PICO>(Threads<OclThreads> &threads, const std::vector<OclDevice> &devices)
|
||||
{
|
||||
return generate("cn-pico", threads, Algorithm::CN_PICO_0, devices);
|
||||
return generate(Algorithm::kCN_PICO, threads, Algorithm::CN_PICO_0, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -109,7 +103,7 @@ size_t inline generate<Algorithm::CN_PICO>(Threads<OclThreads> &threads, const s
|
|||
template<>
|
||||
size_t inline generate<Algorithm::CN_FEMTO>(Threads<OclThreads>& threads, const std::vector<OclDevice>& devices)
|
||||
{
|
||||
return generate("cn/upx2", threads, Algorithm::CN_UPX2, devices);
|
||||
return generate(Algorithm::kCN_UPX2, threads, Algorithm::CN_UPX2, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -125,14 +119,14 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<OclThreads> &threads, const
|
|||
auto arq = OclThreads(devices, Algorithm::RX_ARQ);
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
|
||||
count += threads.move("rx/wow", std::move(wow));
|
||||
count += threads.move(Algorithm::kRX_WOW, std::move(wow));
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_ARQ) && arq != rx) {
|
||||
count += threads.move("rx/arq", std::move(arq));
|
||||
count += threads.move(Algorithm::kRX_ARQ, std::move(arq));
|
||||
}
|
||||
|
||||
count += threads.move("rx", std::move(rx));
|
||||
count += threads.move(Algorithm::kRX, std::move(rx));
|
||||
|
||||
return count;
|
||||
}
|
||||
|
@ -143,7 +137,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<OclThreads> &threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<OclThreads>& threads, const std::vector<OclDevice>& devices)
|
||||
{
|
||||
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, devices);
|
||||
return generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -152,7 +146,7 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<OclThreads>& threads, const
|
|||
template<>
|
||||
size_t inline generate<Algorithm::KAWPOW>(Threads<OclThreads>& threads, const std::vector<OclDevice>& devices)
|
||||
{
|
||||
return generate("kawpow", threads, Algorithm::KAWPOW_RVN, devices);
|
||||
return generate(Algorithm::kKAWPOW, threads, Algorithm::KAWPOW_RVN, devices);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,42 +1,44 @@
|
|||
#define ALGO_CN_0 0
|
||||
#define ALGO_CN_1 1
|
||||
#define ALGO_CN_2 2
|
||||
#define ALGO_CN_R 3
|
||||
#define ALGO_CN_FAST 4
|
||||
#define ALGO_CN_HALF 5
|
||||
#define ALGO_CN_XAO 6
|
||||
#define ALGO_CN_RTO 7
|
||||
#define ALGO_CN_RWZ 8
|
||||
#define ALGO_CN_ZLS 9
|
||||
#define ALGO_CN_DOUBLE 10
|
||||
#define ALGO_CN_LITE_0 11
|
||||
#define ALGO_CN_LITE_1 12
|
||||
#define ALGO_CN_HEAVY_0 13
|
||||
#define ALGO_CN_HEAVY_TUBE 14
|
||||
#define ALGO_CN_HEAVY_XHV 15
|
||||
#define ALGO_CN_PICO_0 16
|
||||
#define ALGO_CN_PICO_TLO 17
|
||||
#define ALGO_CN_CCX 18
|
||||
#define ALGO_CN_GPU 19
|
||||
#define ALGO_CN_UPX2 20
|
||||
#define ALGO_RX_0 21
|
||||
#define ALGO_RX_WOW 22
|
||||
#define ALGO_RX_ARQ 23
|
||||
#define ALGO_RX_SFX 24
|
||||
#define ALGO_RX_KEVA 25
|
||||
#define ALGO_AR2_CHUKWA 26
|
||||
#define ALGO_AR2_CHUKWA_V2 27
|
||||
#define ALGO_AR2_WRKZ 28
|
||||
#define ALGO_ASTROBWT_DERO 29
|
||||
#define ALGO_KAWPOW_RVN 30
|
||||
#define ALGO_RX_XLA 31
|
||||
#define ALGO_CN_0 0x63150000
|
||||
#define ALGO_CN_1 0x63150100
|
||||
#define ALGO_CN_2 0x63150200
|
||||
#define ALGO_CN_R 0x63150272
|
||||
#define ALGO_CN_FAST 0x63150166
|
||||
#define ALGO_CN_HALF 0x63150268
|
||||
#define ALGO_CN_XAO 0x63150078
|
||||
#define ALGO_CN_RTO 0x63150172
|
||||
#define ALGO_CN_RWZ 0x63150277
|
||||
#define ALGO_CN_ZLS 0x6315027a
|
||||
#define ALGO_CN_DOUBLE 0x63150264
|
||||
#define ALGO_CN_CCX 0x63150063
|
||||
#define ALGO_CN_LITE_0 0x63140000
|
||||
#define ALGO_CN_LITE_1 0x63140100
|
||||
#define ALGO_CN_HEAVY_0 0x63160000
|
||||
#define ALGO_CN_HEAVY_TUBE 0x63160172
|
||||
#define ALGO_CN_HEAVY_XHV 0x63160068
|
||||
#define ALGO_CN_PICO_0 0x63120200
|
||||
#define ALGO_CN_PICO_TLO 0x63120274
|
||||
#define ALGO_CN_UPX2 0x63110200
|
||||
#define ALGO_RX_0 0x72151200
|
||||
#define ALGO_RX_WOW 0x72141177
|
||||
#define ALGO_RX_ARQMA 0x72121061
|
||||
#define ALGO_RX_SFX 0x72151273
|
||||
#define ALGO_RX_KEVA 0x7214116b
|
||||
#define ALGO_AR2_CHUKWA 0x61130000
|
||||
#define ALGO_AR2_CHUKWA_V2 0x61140000
|
||||
#define ALGO_AR2_WRKZ 0x61120000
|
||||
#define ALGO_ASTROBWT_DERO 0x41000000
|
||||
#define ALGO_KAWPOW_RVN 0x6b0f0000
|
||||
|
||||
#define ALGO_CN_GPU 0x631500ff
|
||||
#define ALGO_RX_XLA 0x721211ff
|
||||
|
||||
#define FAMILY_UNKNOWN 0
|
||||
#define FAMILY_CN 1
|
||||
#define FAMILY_CN_LITE 2
|
||||
#define FAMILY_CN_HEAVY 3
|
||||
#define FAMILY_CN_PICO 4
|
||||
#define FAMILY_RANDOM_X 5
|
||||
#define FAMILY_ARGON2 6
|
||||
#define FAMILY_ASTROBWT 7
|
||||
#define FAMILY_KAWPOW 8
|
||||
#define FAMILY_CN 0x63150000
|
||||
#define FAMILY_CN_LITE 0x63140000
|
||||
#define FAMILY_CN_HEAVY 0x63160000
|
||||
#define FAMILY_CN_PICO 0x63120000
|
||||
#define FAMILY_CN_FEMTO 0x63110000
|
||||
#define FAMILY_RANDOM_X 0x72000000
|
||||
#define FAMILY_ARGON2 0x61000000
|
||||
#define FAMILY_ASTROBWT 0x41000000
|
||||
#define FAMILY_KAWPOW 0x6b000000
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,8 @@
|
|||
/* 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 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright (c) 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -23,7 +18,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/OclThreads.h"
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
|
@ -36,31 +30,31 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
constexpr const size_t oneMiB = 1024u * 1024u;
|
||||
constexpr const size_t oneMiB = 1024U * 1024U;
|
||||
|
||||
|
||||
static inline uint32_t getMaxThreads(const OclDevice &device, const Algorithm &algorithm)
|
||||
{
|
||||
if (device.vendorId() == OCL_VENDOR_NVIDIA && (device.name().contains("P100") || device.name().contains("V100"))) {
|
||||
return 40000u;
|
||||
return 40000U;
|
||||
}
|
||||
|
||||
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2u : 1u;
|
||||
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2U : 1U;
|
||||
|
||||
if (device.vendorId() == OCL_VENDOR_INTEL) {
|
||||
return ratio * device.computeUnits() * 8;
|
||||
}
|
||||
|
||||
return ratio * 1000u;
|
||||
return ratio * 1000U;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t getPossibleIntensity(const OclDevice &device, const Algorithm &algorithm)
|
||||
{
|
||||
const uint32_t maxThreads = getMaxThreads(device, algorithm);
|
||||
const size_t minFreeMem = (maxThreads == 40000u ? 512u : 128u) * oneMiB;
|
||||
const size_t minFreeMem = (maxThreads == 40000U ? 512U : 128U) * oneMiB;
|
||||
const size_t availableMem = device.freeMemSize() - minFreeMem;
|
||||
const size_t perThread = algorithm.l3() + 224u;
|
||||
const size_t perThread = algorithm.l3() + 224U;
|
||||
const auto maxIntensity = static_cast<uint32_t>(availableMem / perThread);
|
||||
|
||||
return std::min<uint32_t>(maxThreads, maxIntensity);
|
||||
|
@ -98,7 +92,7 @@ static uint32_t getStridedIndex(const OclDevice &device, const Algorithm &algori
|
|||
return 0;
|
||||
}
|
||||
|
||||
return CnAlgo<>::base(algorithm) == Algorithm::CN_2 ? 2 : 1;
|
||||
return algorithm.base() == Algorithm::CN_2 ? 2 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
/* 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 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -23,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/OclThreads.h"
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
|
@ -36,7 +28,7 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
constexpr const size_t oneMiB = 1024u * 1024u;
|
||||
constexpr const size_t oneMiB = 1024U * 1024U;
|
||||
|
||||
|
||||
static inline bool isMatch(const OclDevice &device, const Algorithm &algorithm)
|
||||
|
@ -49,23 +41,23 @@ static inline bool isMatch(const OclDevice &device, const Algorithm &algorithm)
|
|||
|
||||
static inline uint32_t getMaxThreads(const OclDevice &device, const Algorithm &algorithm)
|
||||
{
|
||||
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2u : 1u;
|
||||
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2U : 1U;
|
||||
|
||||
if (device.type() == OclDevice::Vega_10) {
|
||||
if (device.computeUnits() == 56 && algorithm.family() == Algorithm::CN && CnAlgo<>::base(algorithm) == Algorithm::CN_2) {
|
||||
return 1792u;
|
||||
if (device.computeUnits() == 56 && algorithm.family() == Algorithm::CN && algorithm.base() == Algorithm::CN_2) {
|
||||
return 1792U;
|
||||
}
|
||||
}
|
||||
|
||||
return ratio * 2024u;
|
||||
return ratio * 2024U;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t getPossibleIntensity(const OclDevice &device, const Algorithm &algorithm)
|
||||
{
|
||||
const uint32_t maxThreads = getMaxThreads(device, algorithm);
|
||||
const size_t availableMem = device.freeMemSize() - (128u * oneMiB);
|
||||
const size_t perThread = algorithm.l3() + 224u;
|
||||
const size_t availableMem = device.freeMemSize() - (128U * oneMiB);
|
||||
const size_t perThread = algorithm.l3() + 224U;
|
||||
const auto maxIntensity = static_cast<uint32_t>(availableMem / perThread);
|
||||
|
||||
return std::min<uint32_t>(maxThreads, maxIntensity);
|
||||
|
@ -88,28 +80,24 @@ static inline uint32_t getIntensity(const OclDevice &device, const Algorithm &al
|
|||
|
||||
static inline uint32_t getWorksize(const Algorithm &algorithm)
|
||||
{
|
||||
Algorithm::Family f = algorithm.family();
|
||||
const auto f = algorithm.family();
|
||||
if (f == Algorithm::CN_PICO || f == Algorithm::CN_FEMTO) {
|
||||
return 64;
|
||||
}
|
||||
|
||||
if (CnAlgo<>::base(algorithm) == Algorithm::CN_2) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
return 8;
|
||||
return algorithm.base() == Algorithm::CN_2 ? 16 : 8;
|
||||
}
|
||||
|
||||
|
||||
static uint32_t getStridedIndex(const Algorithm &algorithm)
|
||||
{
|
||||
return CnAlgo<>::base(algorithm) == Algorithm::CN_2 ? 2 : 1;
|
||||
return algorithm.base() == Algorithm::CN_2 ? 2 : 1;
|
||||
}
|
||||
|
||||
|
||||
static inline uint32_t getMemChunk(const Algorithm &algorithm)
|
||||
{
|
||||
return CnAlgo<>::base(algorithm) == Algorithm::CN_2 ? 1 : 2;
|
||||
return algorithm.base() == Algorithm::CN_2 ? 1 : 2;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
@ -22,7 +16,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/runners/OclCnRunner.h"
|
||||
#include "backend/opencl/kernels/Cn0Kernel.h"
|
||||
#include "backend/opencl/kernels/Cn1Kernel.h"
|
||||
|
@ -39,12 +32,12 @@
|
|||
xmrig::OclCnRunner::OclCnRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data)
|
||||
{
|
||||
uint32_t stridedIndex = data.thread.stridedIndex();
|
||||
Algorithm::Family f = m_algorithm.family();
|
||||
const auto f = m_algorithm.family();
|
||||
|
||||
if (data.device.vendorId() == OCL_VENDOR_NVIDIA) {
|
||||
stridedIndex = 0;
|
||||
}
|
||||
else if (stridedIndex == 1 && (f == Algorithm::CN_PICO || f == Algorithm::CN_FEMTO || (f == Algorithm::CN && CnAlgo<>::base(m_algorithm) == Algorithm::CN_2))) {
|
||||
else if (stridedIndex == 1 && (f == Algorithm::CN_PICO || f == Algorithm::CN_FEMTO || (f == Algorithm::CN && m_algorithm.base() == Algorithm::CN_2))) {
|
||||
stridedIndex = 2;
|
||||
}
|
||||
|
||||
|
@ -52,10 +45,10 @@ xmrig::OclCnRunner::OclCnRunner(size_t index, const OclLaunchData &data) : OclBa
|
|||
m_options += " -DMASK=" + std::to_string(CnAlgo<>::mask(m_algorithm)) + "U";
|
||||
m_options += " -DWORKSIZE=" + std::to_string(data.thread.worksize()) + "U";
|
||||
m_options += " -DSTRIDED_INDEX=" + std::to_string(stridedIndex) + "U";
|
||||
m_options += " -DMEM_CHUNK_EXPONENT=" + std::to_string(1u << data.thread.memChunk()) + "U";
|
||||
m_options += " -DMEM_CHUNK_EXPONENT=" + std::to_string(1U << data.thread.memChunk()) + "U";
|
||||
m_options += " -DMEMORY=" + std::to_string(m_algorithm.l3()) + "LU";
|
||||
m_options += " -DALGO=" + std::to_string(m_algorithm.id());
|
||||
m_options += " -DALGO_BASE=" + std::to_string(CnAlgo<>::base(m_algorithm));
|
||||
m_options += " -DALGO_BASE=" + std::to_string(m_algorithm.base());
|
||||
m_options += " -DALGO_FAMILY=" + std::to_string(m_algorithm.family());
|
||||
m_options += " -DCN_UNROLL=" + std::to_string(data.thread.unrollFactor());
|
||||
}
|
||||
|
@ -96,7 +89,7 @@ void xmrig::OclCnRunner::run(uint32_t nonce, uint32_t *hashOutput)
|
|||
static const cl_uint zero = 0;
|
||||
|
||||
const size_t w_size = data().thread.worksize();
|
||||
const size_t g_thd = ((m_intensity + w_size - 1u) / w_size) * w_size;
|
||||
const size_t g_thd = ((m_intensity + w_size - 1U) / w_size) * w_size;
|
||||
|
||||
assert(g_thd % w_size == 0);
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* 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-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2021 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue