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