RandomX: added support for dataset on host
This commit is contained in:
parent
9d580693db
commit
2c9b034c08
8 changed files with 32 additions and 15 deletions
|
@ -38,7 +38,7 @@ xmrig::CudaDevice::CudaDevice(uint32_t index, int32_t bfactor, int32_t bsleep) :
|
|||
m_index(index)
|
||||
{
|
||||
auto ctx = CudaLib::alloc(index, bfactor, bsleep);
|
||||
if (CudaLib::deviceInfo(ctx, 0, 0, Algorithm::INVALID) != 0) {
|
||||
if (CudaLib::deviceInfo(ctx, 0, 0, Algorithm::INVALID, 0) != 0) {
|
||||
CudaLib::release(ctx);
|
||||
|
||||
return;
|
||||
|
@ -104,7 +104,7 @@ uint32_t xmrig::CudaDevice::smx() const
|
|||
|
||||
void xmrig::CudaDevice::generate(const Algorithm &algorithm, CudaThreads &threads) const
|
||||
{
|
||||
if (CudaLib::deviceInfo(m_ctx, -1, -1, algorithm) != 0) {
|
||||
if (CudaLib::deviceInfo(m_ctx, -1, -1, algorithm, 0) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ static const char *kVersion = "version";
|
|||
using alloc_t = nvid_ctx * (*)(uint32_t, int32_t, int32_t);
|
||||
using cnHash_t = bool (*)(nvid_ctx *, uint32_t, uint64_t, uint64_t, uint32_t *, uint32_t *);
|
||||
using deviceCount_t = uint32_t (*)();
|
||||
using deviceInfo_t = int32_t (*)(nvid_ctx *, int32_t, int32_t, int32_t);
|
||||
using deviceInfo_t = int32_t (*)(nvid_ctx *, int32_t, int32_t, int32_t, int32_t);
|
||||
using deviceInit_t = bool (*)(nvid_ctx *);
|
||||
using deviceInt_t = int32_t (*)(nvid_ctx *, CudaLib::DeviceProperty);
|
||||
using deviceName_t = const char * (*)(nvid_ctx *);
|
||||
|
@ -79,7 +79,7 @@ using lastError_t = const char * (*)(nvid_
|
|||
using pluginVersion_t = const char * (*)();
|
||||
using release_t = void (*)(nvid_ctx *);
|
||||
using rxHash_t = bool (*)(nvid_ctx *, uint32_t, uint64_t, uint32_t *, uint32_t *);
|
||||
using rxPrepare_t = bool (*)(nvid_ctx *, const void *, size_t, uint32_t);
|
||||
using rxPrepare_t = bool (*)(nvid_ctx *, const void *, size_t, bool, uint32_t);
|
||||
using setJob_t = bool (*)(nvid_ctx *, const void *, size_t, int32_t);
|
||||
using version_t = uint32_t (*)(Version);
|
||||
|
||||
|
@ -156,9 +156,9 @@ bool xmrig::CudaLib::rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target,
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, uint32_t batchSize) noexcept
|
||||
bool xmrig::CudaLib::rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept
|
||||
{
|
||||
return pRxPrepare(ctx, dataset, datasetSize, batchSize);
|
||||
return pRxPrepare(ctx, dataset, datasetSize, dataset_host, batchSize);
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,9 +186,9 @@ const char *xmrig::CudaLib::pluginVersion() noexcept
|
|||
}
|
||||
|
||||
|
||||
int xmrig::CudaLib::deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm) 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);
|
||||
return pDeviceInfo(ctx, blocks, threads, algorithm, dataset_host);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -61,7 +61,8 @@ public:
|
|||
DeviceMemoryFree,
|
||||
DevicePciBusID,
|
||||
DevicePciDeviceID,
|
||||
DevicePciDomainID
|
||||
DevicePciDomainID,
|
||||
DeviceDatasetHost,
|
||||
};
|
||||
|
||||
static bool init(const char *fileName = nullptr);
|
||||
|
@ -74,12 +75,12 @@ public:
|
|||
static bool cnHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t height, uint64_t target, uint32_t *rescount, uint32_t *resnonce);
|
||||
static bool deviceInit(nvid_ctx *ctx) noexcept;
|
||||
static bool rxHash(nvid_ctx *ctx, uint32_t startNonce, uint64_t target, uint32_t *rescount, uint32_t *resnonce) noexcept;
|
||||
static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, uint32_t batchSize) noexcept;
|
||||
static bool rxPrepare(nvid_ctx *ctx, const void *dataset, size_t datasetSize, bool dataset_host, uint32_t batchSize) noexcept;
|
||||
static bool setJob(nvid_ctx *ctx, const void *data, size_t size, const Algorithm &algorithm) noexcept;
|
||||
static const char *deviceName(nvid_ctx *ctx) noexcept;
|
||||
static const char *lastError(nvid_ctx *ctx) noexcept;
|
||||
static const char *pluginVersion() noexcept;
|
||||
static int deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm) noexcept;
|
||||
static int deviceInfo(nvid_ctx *ctx, int32_t blocks, int32_t threads, const Algorithm &algorithm, int32_t dataset_host) noexcept;
|
||||
static int32_t deviceInt(nvid_ctx *ctx, DeviceProperty property) noexcept;
|
||||
static nvid_ctx *alloc(uint32_t id, int32_t bfactor, int32_t bsleep) noexcept;
|
||||
static std::string version(uint32_t version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue