mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-10 04:31:03 +00:00
Set scrypt settings and buffer size in ocl.c code to be future modifiable.
This commit is contained in:
parent
bd10764e76
commit
243d005b1b
@ -1004,8 +1004,8 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint t
|
||||
CL_SET_ARG(clState->CLbuffer0);
|
||||
CL_SET_ARG(clState->outputBuffer);
|
||||
CL_SET_ARG(clState->padbuffer8);
|
||||
CL_SET_VARG(4, &midstate[0]);
|
||||
CL_SET_VARG(4, &midstate[16]);
|
||||
CL_SET_ARG(midstate[0]);
|
||||
CL_SET_ARG(midstate[16]);
|
||||
|
||||
#if 0
|
||||
clSetKernelArg(clState->kernel,0,sizeof(cl_mem), &clState->CLbuffer[0]);
|
||||
|
23
ocl.c
23
ocl.c
@ -464,6 +464,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef USE_SCRYPT
|
||||
if (opt_scrypt) {
|
||||
clState->lookup_gap = 1;
|
||||
clState->thread_concurrency = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
strcat(binaryfilename, name);
|
||||
if (clState->goffset)
|
||||
strcat(binaryfilename, "g");
|
||||
@ -535,10 +542,13 @@ build:
|
||||
/* create a cl program executable for all the devices specified */
|
||||
char *CompilerOptions = calloc(1, 256);
|
||||
|
||||
if (opt_scrypt) {
|
||||
sprintf(CompilerOptions, "-D LOOKUP_GAP=1 -D CONCURRENT_THREADS=1 -D WORKSIZE=%d",
|
||||
(int)clState->wsize);
|
||||
} else {
|
||||
#ifdef USE_SCRYPT
|
||||
if (opt_scrypt)
|
||||
sprintf(CompilerOptions, "-D LOOKUP_GAP=%d -D CONCURRENT_THREADS=%d -D WORKSIZE=%d",
|
||||
(int)clState->lookup_gap, (int)clState->thread_concurrency, (int)clState->wsize);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sprintf(CompilerOptions, "-D WORKSIZE=%d -D VECTORS%d -D WORKVEC=%d",
|
||||
(int)clState->wsize, clState->vwidth, (int)clState->wsize * clState->vwidth);
|
||||
}
|
||||
@ -734,8 +744,11 @@ built:
|
||||
|
||||
#ifdef USE_SCRYPT
|
||||
if (opt_scrypt) {
|
||||
size_t ipt = (1024 / clState->lookup_gap + (1024 % clState->lookup_gap > 0));
|
||||
size_t bufsize = 128 * ipt * clState->thread_concurrency;
|
||||
|
||||
clState->CLbuffer0 = clCreateBuffer(clState->context, CL_MEM_READ_ONLY, 128, NULL, &status);
|
||||
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, 131072, NULL, &status);
|
||||
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, bufsize, NULL, &status);
|
||||
}
|
||||
#endif
|
||||
clState->outputBuffer = clCreateBuffer(clState->context, CL_MEM_WRITE_ONLY, BUFFERSIZE, NULL, &status);
|
||||
|
Loading…
x
Reference in New Issue
Block a user