From ffe1318f7080db83c6e53d3560ee876fe1f57409 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 21 Jul 2012 16:05:50 +1000 Subject: [PATCH] Ignore negative intensities for scrypt. --- driver-opencl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/driver-opencl.c b/driver-opencl.c index c578a98c..e44faeff 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;