From d3ad87f5d299b8b5de787b706f27a74561e8a91f Mon Sep 17 00:00:00 2001 From: ckolivas Date: Wed, 22 Feb 2012 20:13:23 +1100 Subject: [PATCH] Allow writing of multiple worksizes to the configuration file. --- cgminer.c | 4 ++++ ocl.c | 1 + 2 files changed, 5 insertions(+) diff --git a/cgminer.c b/cgminer.c index 6fa5f987..8784544b 100644 --- a/cgminer.c +++ b/cgminer.c @@ -2308,6 +2308,10 @@ void write_config(FILE *fcfg) for(i = 0; i < nDevs; i++) fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].vwidth); + fputs("\",\n\"worksize\" : \"", fcfg); + for(i = 0; i < nDevs; i++) + fprintf(fcfg, "%s%d", i > 0 ? "," : "", + (int)gpus[i].work_size); #ifdef HAVE_ADL fputs("\",\n\"gpu-engine\" : \"", fcfg); for(i = 0; i < nDevs; i++) diff --git a/ocl.c b/ocl.c index 9ab58ac1..f8924365 100644 --- a/ocl.c +++ b/ocl.c @@ -356,6 +356,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) clState->wsize = 64; else clState->wsize = (clState->max_work_size <= 256 ? clState->max_work_size : 256) / clState->vwidth; + gpus[gpu].work_size = clState->wsize; /* Create binary filename based on parameters passed to opencl * compiler to ensure we only load a binary that matches what would