Browse Source

opencl: reuse strbuf in initCl, get rid of poorly-named numbuf.

build-mingw
Noel Maersk 11 years ago
parent
commit
e02f111dca
  1. 15
      ocl.c

15
ocl.c

@ -410,8 +410,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
*/ */
char binaryfilename[255]; char binaryfilename[255];
char filename[255]; char filename[255];
char numbuf[16]; char strbuf[32];
char strbuf[255];
if (cgpu->kernelname == NULL) { if (cgpu->kernelname == NULL) {
applog(LOG_INFO, "No kernel specified, defaulting to ckolivas"); applog(LOG_INFO, "No kernel specified, defaulting to ckolivas");
@ -502,13 +501,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
if (clState->goffset) if (clState->goffset)
strcat(binaryfilename, "g"); strcat(binaryfilename, "g");
sprintf(numbuf, "lg%utc%unf%u", cgpu->lookup_gap, (unsigned int)cgpu->thread_concurrency, algorithm->nfactor); sprintf(strbuf, "lg%utc%unf%u", cgpu->lookup_gap, (unsigned int)cgpu->thread_concurrency, algorithm->nfactor);
strcat(binaryfilename, numbuf); strcat(binaryfilename, strbuf);
sprintf(numbuf, "w%d", (int)clState->wsize); sprintf(strbuf, "w%d", (int)clState->wsize);
strcat(binaryfilename, numbuf); strcat(binaryfilename, strbuf);
sprintf(numbuf, "l%d", (int)sizeof(long)); sprintf(strbuf, "l%d", (int)sizeof(long));
strcat(binaryfilename, numbuf); strcat(binaryfilename, strbuf);
strcat(binaryfilename, ".bin"); strcat(binaryfilename, ".bin");
binaryfile = fopen(binaryfilename, "rb"); binaryfile = fopen(binaryfilename, "rb");

Loading…
Cancel
Save