Commit 43752ee58c4b26216dee509274d0e44c76a7181f

Con Kolivas 2012-07-26T16:12:45

Limit thread concurrency for scrypt to 5xshaders if shaders is specified.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/ocl.c b/ocl.c
index 71b69ac..5fe7b1b 100644
--- a/ocl.c
+++ b/ocl.c
@@ -482,8 +482,11 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 		}
 		if (!cgpu->thread_concurrency) {
 			cgpu->thread_concurrency = ma / 32768 / cgpu->lookup_gap;
-			if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders)
+			if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) {
 				cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders;
+				if (cgpu->thread_concurrency > cgpu->shaders * 5)
+					cgpu->thread_concurrency = cgpu->shaders * 5;
+			}
 				
 			applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %u",gpu,  cgpu->thread_concurrency);
 		}