Browse Source

Ignore negative intensities for scrypt.

Con Kolivas 13 years ago
parent
commit
ffe1318f70
1 changed files with 6 additions and 1 deletions
  1. 6 1
      driver-opencl.c

+ 6 - 1
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;