Browse Source

Change the scale of intensity for scrypt kernel and fix a build warning.

Con Kolivas 13 years ago
parent
commit
04f55a0e66
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-opencl.c

+ 2 - 2
driver-opencl.c

@@ -995,7 +995,7 @@ static cl_int queue_diablo_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint t
 #ifdef USE_SCRYPT
 #ifdef USE_SCRYPT
 static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_unused cl_uint threads)
 static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_unused cl_uint threads)
 {
 {
-	char *midstate = blk->work->midstate;
+	unsigned char *midstate = blk->work->midstate;
 	cl_kernel *kernel = &clState->kernel;
 	cl_kernel *kernel = &clState->kernel;
 	unsigned int num = 0;
 	unsigned int num = 0;
 	cl_uint le_target;
 	cl_uint le_target;
@@ -1020,7 +1020,7 @@ static void set_threads_hashes(unsigned int vectors, unsigned int *threads,
 			       int64_t *hashes, size_t *globalThreads,
 			       int64_t *hashes, size_t *globalThreads,
 			       unsigned int minthreads, int intensity)
 			       unsigned int minthreads, int intensity)
 {
 {
-	*threads = 1 << (15 + intensity);
+	*threads = 1 << ((opt_scrypt ? 0 : 15) + intensity);
 	if (*threads < minthreads)
 	if (*threads < minthreads)
 		*threads = minthreads;
 		*threads = minthreads;
 	*globalThreads = *threads;
 	*globalThreads = *threads;