mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-05 18:39:57 +00:00
Merge pull request #2961 from SChernykh/derohe_cuda
Dero HE (astrobwt/v2) CUDA config generator
This commit is contained in:
commit
afd79e7537
3 changed files with 23 additions and 4 deletions
|
@ -139,7 +139,14 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
||||||
template<>
|
template<>
|
||||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
size_t inline generate<Algorithm::ASTROBWT>(Threads<CudaThreads> &threads, const std::vector<CudaDevice> &devices)
|
||||||
{
|
{
|
||||||
return generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
|
size_t count = 0;
|
||||||
|
|
||||||
|
if (!threads.isExist(Algorithm::ASTROBWT_DERO_2)) {
|
||||||
|
count += threads.move(Algorithm::kASTROBWT_DERO_2, CudaThreads(devices, Algorithm::ASTROBWT_DERO_2));
|
||||||
|
}
|
||||||
|
|
||||||
|
count += generate(Algorithm::kASTROBWT, threads, Algorithm::ASTROBWT_DERO, devices);
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,17 @@
|
||||||
constexpr uint32_t xmrig::CudaAstroBWTRunner::BWT_DATA_STRIDE;
|
constexpr uint32_t xmrig::CudaAstroBWTRunner::BWT_DATA_STRIDE;
|
||||||
|
|
||||||
|
|
||||||
xmrig::CudaAstroBWTRunner::CudaAstroBWTRunner(size_t index, const CudaLaunchData &data) :
|
xmrig::CudaAstroBWTRunner::CudaAstroBWTRunner(size_t index, const CudaLaunchData &data)
|
||||||
CudaBaseRunner(index, data)
|
: CudaBaseRunner(index, data)
|
||||||
|
, m_algorithm(data.algorithm)
|
||||||
{
|
{
|
||||||
m_intensity = m_data.thread.threads() * m_data.thread.blocks();
|
m_intensity = m_data.thread.threads() * m_data.thread.blocks();
|
||||||
m_intensity -= m_intensity % 32;
|
m_intensity -= m_intensity % 32;
|
||||||
|
|
||||||
|
// Dero HE has very fast blocks, so we can't use high intensity
|
||||||
|
if ((m_algorithm == Algorithm::ASTROBWT_DERO_2) && (m_intensity > 4096)) {
|
||||||
|
m_intensity = 4096;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,10 +64,14 @@ bool xmrig::CudaAstroBWTRunner::set(const Job &job, uint8_t *blob)
|
||||||
|
|
||||||
size_t xmrig::CudaAstroBWTRunner::roundSize() const
|
size_t xmrig::CudaAstroBWTRunner::roundSize() const
|
||||||
{
|
{
|
||||||
|
if (m_algorithm == Algorithm::ASTROBWT_DERO_2) {
|
||||||
|
return m_intensity;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr uint32_t STAGE1_SIZE = 147253;
|
constexpr uint32_t STAGE1_SIZE = 147253;
|
||||||
constexpr uint32_t STAGE1_DATA_STRIDE = (STAGE1_SIZE + 256 + 255) & ~255U;
|
constexpr uint32_t STAGE1_DATA_STRIDE = (STAGE1_SIZE + 256 + 255) & ~255U;
|
||||||
|
|
||||||
const uint32_t BATCH2_SIZE = m_intensity;
|
const uint32_t BATCH2_SIZE = static_cast<uint32_t>(m_intensity);
|
||||||
const uint32_t BWT_ALLOCATION_SIZE = BATCH2_SIZE * BWT_DATA_STRIDE;
|
const uint32_t BWT_ALLOCATION_SIZE = BATCH2_SIZE * BWT_DATA_STRIDE;
|
||||||
const uint32_t BATCH1_SIZE = (BWT_ALLOCATION_SIZE / STAGE1_DATA_STRIDE) & ~255U;
|
const uint32_t BATCH1_SIZE = (BWT_ALLOCATION_SIZE / STAGE1_DATA_STRIDE) & ~255U;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cuda/runners/CudaBaseRunner.h"
|
#include "backend/cuda/runners/CudaBaseRunner.h"
|
||||||
|
#include "base/crypto/Algorithm.h"
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
@ -50,6 +51,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t m_intensity = 0;
|
size_t m_intensity = 0;
|
||||||
|
Algorithm m_algorithm;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue