OpenCL RandomX WIP

This commit is contained in:
XMRig 2019-09-11 15:48:02 +07:00
parent ff89ec660c
commit 4c90f9960e
72 changed files with 1717 additions and 505 deletions

View file

@ -41,22 +41,27 @@ xmrig::CnBranchKernel::CnBranchKernel(size_t index, cl_program program) : OclKer
}
bool xmrig::CnBranchKernel::enqueue(cl_command_queue queue, uint32_t nonce, size_t threads, size_t worksize)
void xmrig::CnBranchKernel::enqueue(cl_command_queue queue, uint32_t nonce, size_t threads, size_t worksize)
{
const size_t offset = nonce;
const size_t gthreads = threads;
const size_t lthreads = worksize;
return enqueueNDRange(queue, 1, &offset, &gthreads, &lthreads);
enqueueNDRange(queue, 1, &offset, &gthreads, &lthreads);
}
// __kernel void Skein(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
bool xmrig::CnBranchKernel::setArgs(cl_mem states, cl_mem branch, cl_mem output, uint64_t target, uint32_t threads)
void xmrig::CnBranchKernel::setArgs(cl_mem states, cl_mem branch, cl_mem output, uint32_t threads)
{
return setArg(0, sizeof(cl_mem), &states) &&
setArg(1, sizeof(cl_mem), &branch) &&
setArg(2, sizeof(cl_mem), &output) &&
setArg(3, sizeof(cl_ulong), &target) &&
setArg(4, sizeof(cl_uint), &threads);
setArg(0, sizeof(cl_mem), &states);
setArg(1, sizeof(cl_mem), &branch);
setArg(2, sizeof(cl_mem), &output);
setArg(4, sizeof(cl_uint), &threads);
}
void xmrig::CnBranchKernel::setTarget(uint64_t target)
{
setArg(3, sizeof(cl_ulong), &target);
}