Use different variables for command line specified lookup gap and thread concurrency to differentiate user defined versus auto chosen values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
diff --git a/driver-opencl.c b/driver-opencl.c
index 2027a8f..b6dfe12 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -163,16 +163,16 @@ char *set_lookup_gap(char *arg)
return "Invalid parameters for set lookup gap";
val = atoi(nextptr);
- gpus[device++].lookup_gap = val;
+ gpus[device++].opt_lg = val;
while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
- gpus[device++].lookup_gap = val;
+ gpus[device++].opt_lg = val;
}
if (device == 1) {
for (i = device; i < MAX_GPUDEVICES; i++)
- gpus[i].lookup_gap = gpus[0].lookup_gap;
+ gpus[i].opt_lg = gpus[0].opt_lg;
}
return NULL;
@@ -188,16 +188,16 @@ char *set_thread_concurrency(char *arg)
return "Invalid parameters for set thread concurrency";
val = atoi(nextptr);
- gpus[device++].thread_concurrency = val;
+ gpus[device++].opt_tc = val;
while ((nextptr = strtok(NULL, ",")) != NULL) {
val = atoi(nextptr);
- gpus[device++].thread_concurrency = val;
+ gpus[device++].opt_tc = val;
}
if (device == 1) {
for (i = device; i < MAX_GPUDEVICES; i++)
- gpus[i].thread_concurrency = gpus[0].thread_concurrency;
+ gpus[i].opt_tc = gpus[0].opt_tc;
}
return NULL;
diff --git a/miner.h b/miner.h
index 2f51e3a..04b765c 100644
--- a/miner.h
+++ b/miner.h
@@ -362,8 +362,8 @@ struct cgpu_info {
cl_ulong max_alloc;
#ifdef USE_SCRYPT
- int lookup_gap;
- int thread_concurrency;
+ int opt_lg, lookup_gap;
+ int opt_tc, thread_concurrency;
int shaders;
#endif
struct timeval tv_gpustart;;
diff --git a/ocl.c b/ocl.c
index e71b9cc..9e9ef02 100644
--- a/ocl.c
+++ b/ocl.c
@@ -476,11 +476,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
cl_ulong ma = cgpu->max_alloc, mt;
int pow2 = 0;
- if (!cgpu->lookup_gap) {
+ if (!cgpu->opt_lg) {
applog(LOG_DEBUG, "GPU %d: selecting lookup gap of 2", gpu);
cgpu->lookup_gap = 2;
- }
- if (!cgpu->thread_concurrency) {
+ } else
+ cgpu->lookup_gap = cgpu->opt_lg;
+
+ if (!cgpu->opt_tc) {
cgpu->thread_concurrency = ma / 32768 / cgpu->lookup_gap;
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) {
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders;
@@ -489,7 +491,8 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
}
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu, cgpu->thread_concurrency);
- }
+ } else
+ cgpu->thread_concurrency = cgpu->opt_tc;
/* If we have memory to spare, try to find a power of 2 value
* >= required amount to map nicely to an intensity */