1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-03-09 20:21:01 +00:00

Bugfix: Iterate over devices rather than threads for watchdog (and ADL)

This commit is contained in:
Luke Dashjr 2012-01-20 17:29:52 -05:00
parent d9ccb3b485
commit 9a0bcc8890
2 changed files with 6 additions and 5 deletions

10
main.c
View File

@ -5005,14 +5005,12 @@ static void *watchdog_thread(void *userdata)
}
#ifdef HAVE_OPENCL
for (i = 0; i < mining_threads; i++) {
struct thr_info *thr;
for (i = 0; i < total_devices; ++i) {
struct cgpu_info *cgpu = devices[i];
struct thr_info *thr = cgpu->thread;
bool *enable;
struct cgpu_info *cgpu;
int gpu;
thr = &thr_info[i];
cgpu = thr->cgpu;
if (cgpu->api != &opencl_api)
continue;
/* Use only one thread per device to determine if the GPU is healthy */
@ -6221,6 +6219,8 @@ retry_pools:
if (unlikely(thr_info_create(thr, NULL, miner_thread, thr)))
quit(1, "thread %d create failed", thr->id);
cgpu->thread = thr;
}
}

View File

@ -252,6 +252,7 @@ struct cgpu_info {
struct timeval last_message_tv;
int threads;
struct thr_info *thread;
bool dynamic;
int intensity;