Browse Source

kernel: integrate Zuikkis' kernel, selectable with `--kernel=zuikkis`.

Kernel ckolivas is still the default. Needs documentation, too.

https://github.com/veox/sgminer/issues/4
nfactor-troky
Noel Maersk 11 years ago
parent
commit
7950c10374
  1. 1
      configure.ac
  2. 10
      driver-opencl.c
  3. 1
      miner.h
  4. 6
      ocl.c
  5. 3
      sgminer.c

1
configure.ac

@ -318,6 +318,7 @@ fi @@ -318,6 +318,7 @@ fi
AC_DEFINE_UNQUOTED([SGMINER_PREFIX], ["$prefix/bin"], [Path to sgminer install])
AC_DEFINE_UNQUOTED([CKOLIVAS_KERNNAME], ["ckolivas"], [Filename for original scrypt kernel])
AC_DEFINE_UNQUOTED([ZUIKKIS_KERNNAME], ["zuikkis"], [Filename for Zuikkis' optimised kernel])
AC_SUBST(OPENCL_LIBS)

10
driver-opencl.c

@ -198,6 +198,8 @@ static enum cl_kernels select_kernel(char *arg) @@ -198,6 +198,8 @@ static enum cl_kernels select_kernel(char *arg)
{
if (!strcmp(arg, "ckolivas"))
return KL_CKOLIVAS;
if (!strcmp(arg, "zuikkis"))
return KL_ZUIKKIS;
return KL_NONE;
}
@ -1211,7 +1213,10 @@ static bool opencl_thread_prepare(struct thr_info *thr) @@ -1211,7 +1213,10 @@ static bool opencl_thread_prepare(struct thr_info *thr)
{
switch (clStates[i]->chosen_kernel) {
case KL_CKOLIVAS:
cgpu->kname = "scrypt";
cgpu->kname = "ckolivas";
break;
case KL_ZUIKKIS:
cgpu->kname = "zuikkis";
break;
default:
break;
@ -1244,6 +1249,9 @@ static bool opencl_thread_init(struct thr_info *thr) @@ -1244,6 +1249,9 @@ static bool opencl_thread_init(struct thr_info *thr)
case KL_CKOLIVAS:
thrdata->queue_kernel_parameters = &queue_scrypt_kernel;
break;
case KL_ZUIKKIS:
thrdata->queue_kernel_parameters = &queue_scrypt_kernel;
break;
default:
break;
}

1
miner.h

@ -373,6 +373,7 @@ enum dev_enable { @@ -373,6 +373,7 @@ enum dev_enable {
enum cl_kernels {
KL_NONE,
KL_CKOLIVAS,
KL_ZUIKKIS,
};
enum dev_reason {

6
ocl.c

@ -422,6 +422,12 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) @@ -422,6 +422,12 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
/* Scrypt only supports vector 1 */
cgpu->vwidth = 1;
break;
case KL_ZUIKKIS:
strcpy(filename, ZUIKKIS_KERNNAME".cl");
strcpy(binaryfilename, ZUIKKIS_KERNNAME);
/* Scrypt only supports vector 1 */
cgpu->vwidth = 1;
break;
case KL_NONE: /* Shouldn't happen */
break;
}

3
sgminer.c

@ -4124,6 +4124,9 @@ void write_config(FILE *fcfg) @@ -4124,6 +4124,9 @@ void write_config(FILE *fcfg)
case KL_CKOLIVAS:
fprintf(fcfg, "ckolivas");
break;
case KL_ZUIKKIS:
fprintf(fcfg, "zuikkis");
break;
}
}
fputs("\",\n\"lookup-gap\" : \"", fcfg);

Loading…
Cancel
Save