Commit 584fc013ab7381400e6cbf0e9b2d53d3a0f2cea1

Con Kolivas 2013-03-15T22:31:46

Use a new algorithm for choosing a thread concurrency when none or no shader value is specified for scrypt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/ocl.c b/ocl.c
index 0c527c2..635090b 100644
--- a/ocl.c
+++ b/ocl.c
@@ -482,7 +482,10 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 			cgpu->lookup_gap = cgpu->opt_lg;
 
 		if (!cgpu->opt_tc) {
-			cgpu->thread_concurrency = cgpu->max_alloc / 32768 / cgpu->lookup_gap;
+			unsigned int sixtyfours;
+
+			sixtyfours =  cgpu->max_alloc / 131072 / 64 - 1;
+			cgpu->thread_concurrency = sixtyfours * 64;
 			if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) {
 				cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders;
 				if (cgpu->thread_concurrency > cgpu->shaders * 5)