mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-31 15:05:59 +00:00
Allow use old CUDA plugin.
This commit is contained in:
parent
a25042db72
commit
449617d717
4 changed files with 14 additions and 16 deletions
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cuda/wrappers/CudaLib.h"
|
#include "backend/cuda/wrappers/CudaLib.h"
|
||||||
|
#include "crypto/rx/RxAlgo.h"
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
@ -163,7 +164,7 @@ bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datase
|
||||||
|
|
||||||
bool xmrig::CudaLib::setJob(nvid_ctx *ctx, const void *data, size_t size, const Algorithm &algorithm) noexcept
|
bool xmrig::CudaLib::setJob(nvid_ctx *ctx, const void *data, size_t size, const Algorithm &algorithm) noexcept
|
||||||
{
|
{
|
||||||
return pSetJob(ctx, data, size, algorithm);
|
return pSetJob(ctx, data, size, RxAlgo::id(algorithm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,7 +188,7 @@ const char *xmrig::CudaLib::pluginVersion() noexcept
|
||||||
|
|
||||||
int xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host) noexcept
|
int xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host) noexcept
|
||||||
{
|
{
|
||||||
return pDeviceInfo(ctx, blocks, threads, algorithm, dataset_host);
|
return pDeviceInfo(ctx, blocks, threads, RxAlgo::id(algorithm), dataset_host);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "backend/opencl/OclLaunchData.h"
|
#include "backend/opencl/OclLaunchData.h"
|
||||||
#include "backend/common/Tags.h"
|
#include "backend/common/Tags.h"
|
||||||
#include "backend/opencl/OclConfig.h"
|
#include "backend/opencl/OclConfig.h"
|
||||||
#include "crypto/rx/RxAlgo.h"
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::OclLaunchData::OclLaunchData(const Miner *miner, const Algorithm &algorithm, const OclConfig &config, const OclPlatform &platform, const OclThread &thread, const OclDevice &device, int64_t affinity) :
|
xmrig::OclLaunchData::OclLaunchData(const Miner *miner, const Algorithm &algorithm, const OclConfig &config, const OclPlatform &platform, const OclThread &thread, const OclDevice &device, int64_t affinity) :
|
||||||
|
@ -44,8 +43,8 @@ xmrig::OclLaunchData::OclLaunchData(const Miner *miner, const Algorithm &algorit
|
||||||
|
|
||||||
bool xmrig::OclLaunchData::isEqual(const OclLaunchData &other) const
|
bool xmrig::OclLaunchData::isEqual(const OclLaunchData &other) const
|
||||||
{
|
{
|
||||||
return (RxAlgo::id(other.algorithm) == RxAlgo::id(algorithm) &&
|
return (other.algorithm == algorithm &&
|
||||||
other.thread == thread);
|
other.thread == thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,16 +37,6 @@ xmrig::Algorithm::Id xmrig::RxAlgo::apply(Algorithm::Id algorithm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xmrig::Algorithm::Id xmrig::RxAlgo::id(Algorithm::Id algorithm)
|
|
||||||
{
|
|
||||||
if (algorithm == Algorithm::RX_SFX || algorithm == Algorithm::RX_V) {
|
|
||||||
return Algorithm::RX_0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return algorithm;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm)
|
const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm)
|
||||||
{
|
{
|
||||||
switch (algorithm) {
|
switch (algorithm) {
|
||||||
|
|
|
@ -46,12 +46,20 @@ class RxAlgo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Algorithm::Id apply(Algorithm::Id algorithm);
|
static Algorithm::Id apply(Algorithm::Id algorithm);
|
||||||
static Algorithm::Id id(Algorithm::Id algorithm);
|
|
||||||
static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm);
|
static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm);
|
||||||
static uint32_t programCount(Algorithm::Id algorithm);
|
static uint32_t programCount(Algorithm::Id algorithm);
|
||||||
static uint32_t programIterations(Algorithm::Id algorithm);
|
static uint32_t programIterations(Algorithm::Id algorithm);
|
||||||
static uint32_t programSize(Algorithm::Id algorithm);
|
static uint32_t programSize(Algorithm::Id algorithm);
|
||||||
static uint32_t version(Algorithm::Id algorithm);
|
static uint32_t version(Algorithm::Id algorithm);
|
||||||
|
|
||||||
|
static inline Algorithm::Id id(Algorithm::Id algorithm)
|
||||||
|
{
|
||||||
|
if (algorithm == Algorithm::RX_SFX || algorithm == Algorithm::RX_V) {
|
||||||
|
return Algorithm::RX_0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return algorithm;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue