From e8978db55f26dd6ff789e6c6b757d5dd4dbfc367 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Thu, 23 Jan 2014 20:05:57 +0200 Subject: [PATCH] kernel: slight refactor, add warnings about new kernels, and known limitations of zuikkis. Limitations of alexkar* kernels are not known to me. Closes https://github.com/veox/sgminer/issues/28 --- ocl.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ocl.c b/ocl.c index 159f25fc..3fb6c98f 100644 --- a/ocl.c +++ b/ocl.c @@ -415,30 +415,32 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) else if (preferred_vwidth > 2) preferred_vwidth = 2; + /* All available kernels only support vector 1 */ + cgpu->vwidth = 1; + switch (clState->chosen_kernel) { case KL_ALEXKARNEW: + applog(LOG_WARNING, "Kernel alexkarnew is experimental."); strcpy(filename, ALEXKARNEW_KERNNAME".cl"); strcpy(binaryfilename, ALEXKARNEW_KERNNAME); - /* Kernel only supports vector 1 */ - cgpu->vwidth = 1; break; case KL_ALEXKAROLD: + applog(LOG_WARNING, "Kernel alexkarold is experimental."); strcpy(filename, ALEXKAROLD_KERNNAME".cl"); strcpy(binaryfilename, ALEXKAROLD_KERNNAME); - /* Kernel only supports vector 1 */ - cgpu->vwidth = 1; break; case KL_CKOLIVAS: strcpy(filename, CKOLIVAS_KERNNAME".cl"); strcpy(binaryfilename, CKOLIVAS_KERNNAME); - /* Kernel only supports vector 1 */ - cgpu->vwidth = 1; break; case KL_ZUIKKIS: + applog(LOG_WARNING, "Kernel zuikkis is experimental."); strcpy(filename, ZUIKKIS_KERNNAME".cl"); strcpy(binaryfilename, ZUIKKIS_KERNNAME); - /* Kernel only supports vector 1 */ - cgpu->vwidth = 1; + /* Kernel only supports lookup-gap 2 */ + cgpu->lookup_gap = 2; + /* Kernel only supports worksize 256 */ + cgpu->work_size = 256; break; case KL_NONE: /* Shouldn't happen */ break;