|
|
@ -743,10 +743,8 @@ static _clState *clStates[MAX_GPUDEVICES]; |
|
|
|
static cl_int queue_poclbm_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint threads) |
|
|
|
static cl_int queue_poclbm_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint threads) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cl_kernel *kernel = &clState->kernel; |
|
|
|
cl_kernel *kernel = &clState->kernel; |
|
|
|
cl_uint vwidth = clState->vwidth; |
|
|
|
unsigned int num = 0; |
|
|
|
unsigned int i, num = 0; |
|
|
|
|
|
|
|
cl_int status = 0; |
|
|
|
cl_int status = 0; |
|
|
|
uint *nonces; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CL_SET_BLKARG(ctx_a); |
|
|
|
CL_SET_BLKARG(ctx_a); |
|
|
|
CL_SET_BLKARG(ctx_b); |
|
|
|
CL_SET_BLKARG(ctx_b); |
|
|
@ -765,10 +763,15 @@ static cl_int queue_poclbm_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint t |
|
|
|
CL_SET_BLKARG(cty_g); |
|
|
|
CL_SET_BLKARG(cty_g); |
|
|
|
CL_SET_BLKARG(cty_h); |
|
|
|
CL_SET_BLKARG(cty_h); |
|
|
|
|
|
|
|
|
|
|
|
nonces = alloca(sizeof(uint) * vwidth); |
|
|
|
if (!clState->goffset) { |
|
|
|
for (i = 0; i < vwidth; i++) |
|
|
|
cl_uint vwidth = clState->vwidth; |
|
|
|
nonces[i] = blk->nonce + (i * threads); |
|
|
|
uint *nonces = alloca(sizeof(uint) * vwidth); |
|
|
|
CL_SET_VARG(vwidth, nonces); |
|
|
|
unsigned int i; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < vwidth; i++) |
|
|
|
|
|
|
|
nonces[i] = blk->nonce + (i * threads); |
|
|
|
|
|
|
|
CL_SET_VARG(vwidth, nonces); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CL_SET_BLKARG(fW0); |
|
|
|
CL_SET_BLKARG(fW0); |
|
|
|
CL_SET_BLKARG(fW1); |
|
|
|
CL_SET_BLKARG(fW1); |
|
|
@ -896,15 +899,19 @@ static cl_int queue_diakgcn_kernel(_clState *clState, dev_blk_ctx *blk, |
|
|
|
static cl_int queue_diablo_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint threads) |
|
|
|
static cl_int queue_diablo_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint threads) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cl_kernel *kernel = &clState->kernel; |
|
|
|
cl_kernel *kernel = &clState->kernel; |
|
|
|
cl_uint vwidth = clState->vwidth; |
|
|
|
unsigned int num = 0; |
|
|
|
unsigned int i, num = 0; |
|
|
|
|
|
|
|
cl_int status = 0; |
|
|
|
cl_int status = 0; |
|
|
|
uint *nonces; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nonces = alloca(sizeof(uint) * vwidth); |
|
|
|
if (!clState->goffset) { |
|
|
|
for (i = 0; i < vwidth; i++) |
|
|
|
cl_uint vwidth = clState->vwidth; |
|
|
|
nonces[i] = blk->nonce + (i * threads); |
|
|
|
uint *nonces = alloca(sizeof(uint) * vwidth); |
|
|
|
CL_SET_VARG(vwidth, nonces); |
|
|
|
unsigned int i; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < vwidth; i++) |
|
|
|
|
|
|
|
nonces[i] = blk->nonce + (i * threads); |
|
|
|
|
|
|
|
CL_SET_VARG(vwidth, nonces); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CL_SET_BLKARG(PreVal0); |
|
|
|
CL_SET_BLKARG(PreVal0); |
|
|
|
CL_SET_BLKARG(PreVal0addK7); |
|
|
|
CL_SET_BLKARG(PreVal0addK7); |
|
|
@ -1338,8 +1345,16 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work, |
|
|
|
memset(thrdata->res, 0, BUFFERSIZE); |
|
|
|
memset(thrdata->res, 0, BUFFERSIZE); |
|
|
|
clFinish(clState->commandQueue); |
|
|
|
clFinish(clState->commandQueue); |
|
|
|
} |
|
|
|
} |
|
|
|
status = clEnqueueNDRangeKernel(clState->commandQueue, *kernel, 1, NULL, |
|
|
|
|
|
|
|
globalThreads, localThreads, 0, NULL, NULL); |
|
|
|
if (clState->goffset) { |
|
|
|
|
|
|
|
size_t global_work_offset[1]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global_work_offset[0] = work->blk.nonce; |
|
|
|
|
|
|
|
status = clEnqueueNDRangeKernel(clState->commandQueue, *kernel, 1, global_work_offset, |
|
|
|
|
|
|
|
globalThreads, localThreads, 0, NULL, NULL); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
status = clEnqueueNDRangeKernel(clState->commandQueue, *kernel, 1, NULL, |
|
|
|
|
|
|
|
globalThreads, localThreads, 0, NULL, NULL); |
|
|
|
if (unlikely(status != CL_SUCCESS)) { |
|
|
|
if (unlikely(status != CL_SUCCESS)) { |
|
|
|
applog(LOG_ERR, "Error: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)"); |
|
|
|
applog(LOG_ERR, "Error: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)"); |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|