Commit ffe1318f7080db83c6e53d3560ee876fe1f57409

Con Kolivas 2012-07-21T16:05:50

Ignore negative intensities for scrypt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/driver-opencl.c b/driver-opencl.c
index c578a98..e44faef 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -1020,7 +1020,12 @@ static void set_threads_hashes(unsigned int vectors, unsigned int *threads,
 			       int64_t *hashes, size_t *globalThreads,
 			       unsigned int minthreads, int intensity)
 {
-	*threads = 1 << ((opt_scrypt ? 0 : 15) + intensity);
+	if (opt_scrypt) {
+		if (intensity < 0)
+			intensity = 0;
+		*threads = 1 << intensity;
+	} else
+		*threads = 1 << (15 + intensity);
 	if (*threads < minthreads)
 		*threads = minthreads;
 	*globalThreads = *threads;