Browse Source

Bugfix: Fix CPU miner benchmarking within benchmark-intense mode

Luke Dashjr 11 years ago
parent
commit
9aec65e14e
3 changed files with 5 additions and 5 deletions
  1. 1 1
      driver-cpu.c
  2. 3 3
      miner.c
  3. 1 1
      miner.h

+ 1 - 1
driver-cpu.c

@@ -228,7 +228,7 @@ double bench_algo_stage3(
 	struct work work __attribute__((aligned(128)));
 	unsigned char hash1[64];
 
-	get_benchmark_work(&work);
+	get_benchmark_work(&work, false);
 
 	static struct thr_info dummy;
 

+ 3 - 3
miner.c

@@ -5098,9 +5098,9 @@ void setup_benchmark_pool()
 	}
 }
 
-void get_benchmark_work(struct work *work)
+void get_benchmark_work(struct work *work, bool use_swork)
 {
-	if (opt_benchmark_intense)
+	if (use_swork)
 	{
 		gen_stratum_work(pools[0], work);
 		work->getwork_mode = GETWORK_MODE_BENCHMARK;
@@ -12892,7 +12892,7 @@ retry:
 		}
 
 		if (opt_benchmark) {
-			get_benchmark_work(work);
+			get_benchmark_work(work, opt_benchmark_intense);
 			applog(LOG_DEBUG, "Generated benchmark work");
 			stage_work(work);
 			continue;

+ 1 - 1
miner.h

@@ -1438,7 +1438,7 @@ struct work {
 
 extern void get_datestamp(char *, size_t, time_t);
 #define get_now_datestamp(buf, bufsz)  get_datestamp(buf, bufsz, INVALID_TIMESTAMP)
-extern void get_benchmark_work(struct work *);
+extern void get_benchmark_work(struct work *, bool use_swork);
 extern void stratum_work_cpy(struct stratum_work *dst, const struct stratum_work *src);
 extern void stratum_work_clean(struct stratum_work *);
 extern bool pool_has_usable_swork(const struct pool *);