Implemented VM mode for OpenCL RandomX.
This commit is contained in:
parent
4c90f9960e
commit
95daab4bc0
42 changed files with 450 additions and 165 deletions
|
@ -27,6 +27,15 @@
|
|||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
|
||||
|
||||
void xmrig::ExecuteVmKernel::enqueue(cl_command_queue queue, size_t threads, size_t worksize)
|
||||
{
|
||||
const size_t gthreads = (worksize == 16) ? (threads * 16) : (threads * 8);
|
||||
const size_t lthreads = (worksize == 16) ? 32 : 16;
|
||||
|
||||
enqueueNDRange(queue, 1, nullptr, >hreads, <hreads);
|
||||
}
|
||||
|
||||
|
||||
// __kernel void execute_vm(__global void* vm_states, __global void* rounding, __global void* scratchpads, __global const void* dataset_ptr, uint32_t batch_size, uint32_t num_iterations, uint32_t first, uint32_t last)
|
||||
void xmrig::ExecuteVmKernel::setArgs(cl_mem vm_states, cl_mem rounding, cl_mem scratchpads, cl_mem dataset_ptr, uint32_t batch_size)
|
||||
{
|
||||
|
@ -36,3 +45,21 @@ void xmrig::ExecuteVmKernel::setArgs(cl_mem vm_states, cl_mem rounding, cl_mem s
|
|||
setArg(3, sizeof(cl_mem), &dataset_ptr);
|
||||
setArg(4, sizeof(uint32_t), &batch_size);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::ExecuteVmKernel::setFirst(uint32_t first)
|
||||
{
|
||||
setArg(6, sizeof(uint32_t), &first);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::ExecuteVmKernel::setIterations(uint32_t num_iterations)
|
||||
{
|
||||
setArg(5, sizeof(uint32_t), &num_iterations);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::ExecuteVmKernel::setLast(uint32_t last)
|
||||
{
|
||||
setArg(7, sizeof(uint32_t), &last);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue