mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 12:34:27 +00:00
Set the correct data for cldata and prepare for pad8 fixes.
This commit is contained in:
parent
3d1b4d6374
commit
a9a0bba18b
@ -1001,6 +1001,8 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint t
|
|||||||
cl_int status = 0;
|
cl_int status = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
status = clEnqueueWriteBuffer(clState->commandQueue, clState->CLbuffer0, true, 0, 80, clState->cldata, 0, NULL,NULL);
|
||||||
|
|
||||||
CL_SET_ARG(clState->CLbuffer0);
|
CL_SET_ARG(clState->CLbuffer0);
|
||||||
CL_SET_ARG(clState->outputBuffer);
|
CL_SET_ARG(clState->outputBuffer);
|
||||||
CL_SET_ARG(clState->padbuffer8);
|
CL_SET_ARG(clState->padbuffer8);
|
||||||
@ -1309,7 +1311,7 @@ static bool opencl_thread_init(struct thr_info *thr)
|
|||||||
struct cgpu_info *gpu = thr->cgpu;
|
struct cgpu_info *gpu = thr->cgpu;
|
||||||
struct opencl_thread_data *thrdata;
|
struct opencl_thread_data *thrdata;
|
||||||
_clState *clState = clStates[thr_id];
|
_clState *clState = clStates[thr_id];
|
||||||
cl_int status;
|
cl_int status = 0;
|
||||||
thrdata = calloc(1, sizeof(*thrdata));
|
thrdata = calloc(1, sizeof(*thrdata));
|
||||||
thr->cgpu_data = thrdata;
|
thr->cgpu_data = thrdata;
|
||||||
|
|
||||||
@ -1348,10 +1350,13 @@ static bool opencl_thread_init(struct thr_info *thr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SCRYPT
|
#ifdef USE_SCRYPT
|
||||||
if (opt_scrypt)
|
if (opt_scrypt) {
|
||||||
status = clEnqueueWriteBuffer(clState->commandQueue, clState->CLbuffer0, true, 0, BUFFERSIZE, blank_res, 0, NULL,NULL);
|
if (clState->padbufsize > BUFFERSIZE)
|
||||||
|
blank_res = realloc(blank_res, clState->padbufsize);
|
||||||
|
status = clEnqueueWriteBuffer(clState->commandQueue, clState->padbuffer8, true, 0, clState->padbufsize, blank_res, 0, NULL,NULL);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
status = clEnqueueWriteBuffer(clState->commandQueue, clState->outputBuffer, CL_TRUE, 0,
|
status |= clEnqueueWriteBuffer(clState->commandQueue, clState->outputBuffer, CL_TRUE, 0,
|
||||||
BUFFERSIZE, blank_res, 0, NULL, NULL);
|
BUFFERSIZE, blank_res, 0, NULL, NULL);
|
||||||
if (unlikely(status != CL_SUCCESS)) {
|
if (unlikely(status != CL_SUCCESS)) {
|
||||||
applog(LOG_ERR, "Error: clEnqueueWriteBuffer failed.");
|
applog(LOG_ERR, "Error: clEnqueueWriteBuffer failed.");
|
||||||
@ -1440,6 +1445,10 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
localThreads[0], gpu->intensity);
|
localThreads[0], gpu->intensity);
|
||||||
if (hashes > gpu->max_hashes)
|
if (hashes > gpu->max_hashes)
|
||||||
gpu->max_hashes = hashes;
|
gpu->max_hashes = hashes;
|
||||||
|
|
||||||
|
#ifdef USE_SCRYPT
|
||||||
|
clState->cldata = work->data;
|
||||||
|
#endif
|
||||||
status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]);
|
status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]);
|
||||||
if (unlikely(status != CL_SUCCESS)) {
|
if (unlikely(status != CL_SUCCESS)) {
|
||||||
applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
|
applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
|
||||||
|
3
ocl.c
3
ocl.c
@ -754,8 +754,9 @@ built:
|
|||||||
size_t ipt = (1024 / clState->lookup_gap + (1024 % clState->lookup_gap > 0));
|
size_t ipt = (1024 / clState->lookup_gap + (1024 % clState->lookup_gap > 0));
|
||||||
size_t bufsize = 128 * ipt * clState->thread_concurrency;
|
size_t bufsize = 128 * ipt * clState->thread_concurrency;
|
||||||
|
|
||||||
clState->CLbuffer0 = clCreateBuffer(clState->context, CL_MEM_READ_ONLY, 128, NULL, &status);
|
clState->CLbuffer0 = clCreateBuffer(clState->context, CL_MEM_READ_ONLY, 80, NULL, &status);
|
||||||
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, bufsize, NULL, &status);
|
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, bufsize, NULL, &status);
|
||||||
|
clState->padbufsize = bufsize;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
clState->outputBuffer = clCreateBuffer(clState->context, CL_MEM_WRITE_ONLY, BUFFERSIZE, NULL, &status);
|
clState->outputBuffer = clCreateBuffer(clState->context, CL_MEM_WRITE_ONLY, BUFFERSIZE, NULL, &status);
|
||||||
|
2
ocl.h
2
ocl.h
@ -24,6 +24,8 @@ typedef struct {
|
|||||||
cl_mem padbuffer8;
|
cl_mem padbuffer8;
|
||||||
size_t lookup_gap;
|
size_t lookup_gap;
|
||||||
size_t thread_concurrency;
|
size_t thread_concurrency;
|
||||||
|
size_t padbufsize;
|
||||||
|
void * cldata;
|
||||||
#endif
|
#endif
|
||||||
bool hasBitAlign;
|
bool hasBitAlign;
|
||||||
bool hasOpenCL11plus;
|
bool hasOpenCL11plus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user