Browse Source

Merge commit '0face98' into cg_merges_20130524b

Conflicts:
	driver-opencl.c
Luke Dashjr 12 years ago
parent
commit
ae08bdc983
1 changed files with 5 additions and 4 deletions
  1. 5 4
      driver-opencl.c

+ 5 - 4
driver-opencl.c

@@ -44,6 +44,7 @@
 #include "findnonce.h"
 #include "ocl.h"
 #include "adl.h"
+#include "util.h"
 
 /* TODO: cleanup externals ********************/
 
@@ -1355,7 +1356,7 @@ select_cgpu:
 
 		thr->rolling = thr->cgpu->rolling = 0;
 		/* Reports the last time we tried to revive a sick GPU */
-		gettimeofday(&thr->sick, NULL);
+		cgtime(&thr->sick);
 		if (!pthread_cancel(thr->pth)) {
 			applog(LOG_WARNING, "Thread %d still exists, killing it off", thr_id);
 		} else
@@ -1395,7 +1396,7 @@ select_cgpu:
 		applog(LOG_WARNING, "Thread %d restarted", thr_id);
 	}
 
-	gettimeofday(&now, NULL);
+	cgtime(&now);
 	get_datestamp(sel_cgpu->init, &now);
 
 	proc_enable(cgpu);
@@ -1651,7 +1652,7 @@ static bool opencl_thread_prepare(struct thr_info *thr)
 		}
 	}
 	applog(LOG_INFO, "initCl() finished. Found %s", name);
-	gettimeofday(&now, NULL);
+	cgtime(&now);
 	get_datestamp(cgpu->init, &now);
 
 	have_opencl = true;
@@ -1751,7 +1752,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
 		struct timeval tv_gpuend;
 		double gpu_us;
 
-		gettimeofday(&tv_gpuend, NULL);
+		cgtime(&tv_gpuend);
 		gpu_us = us_tdiff(&tv_gpuend, &gpu->tv_gpustart) / gpu->intervals;
 		if (gpu_us > dynamic_us) {
 			if (gpu->intensity > MIN_INTENSITY)