Browse Source

Do not add time to dynamic opencl calculations over a getwork.

Conflicts:
	cgminer.c
Con Kolivas 13 years ago
parent
commit
f934c17fda
3 changed files with 13 additions and 4 deletions
  1. 1 0
      cgminer.c
  2. 10 4
      driver-opencl.c
  3. 2 0
      miner.h

+ 1 - 0
cgminer.c

@@ -4275,6 +4275,7 @@ void *miner_thread(void *userdata)
 			break;
 		}
 		requested = false;
+		cgpu->new_work = true;
 		gettimeofday(&tv_workstart, NULL);
 		work->blk.nonce = 0;
 		cgpu->max_hashes = 0;

+ 10 - 4
driver-opencl.c

@@ -1532,10 +1532,16 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
 		clFinish(clState->commandQueue);
 	}
 
-	gettimeofday(&gpu->tv_gpumid, NULL);
-	if (!gpu->intervals) {
-		gpu->tv_gpustart.tv_sec = gpu->tv_gpumid.tv_sec;
-		gpu->tv_gpustart.tv_usec = gpu->tv_gpumid.tv_usec;
+	if (gpu->dynamic) {
+		gettimeofday(&gpu->tv_gpumid, NULL);
+		if (gpu->new_work) {
+			gpu->new_work = false;
+			gpu->intervals = 0;
+		}
+		if (!gpu->intervals) {
+			gpu->tv_gpustart.tv_sec = gpu->tv_gpumid.tv_sec;
+			gpu->tv_gpustart.tv_usec = gpu->tv_gpumid.tv_usec;
+		}
 	}
 
 	status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]);

+ 2 - 0
miner.h

@@ -373,6 +373,8 @@ struct cgpu_info {
 	int intervals, hit;
 #endif
 
+	bool new_work;
+
 	float temp;
 	int cutofftemp;