mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
The amount of work scanned can fluctuate when intensity changes and since we do this one cycle behind, we increment the work more than enough to prevent repeating work.
This commit is contained in:
parent
158c09107c
commit
29f0b2714c
@ -1217,8 +1217,12 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
++gpu->intensity;
|
++gpu->intensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!work->blk.nonce)
|
||||||
|
gpu->max_hashes = 0;
|
||||||
set_threads_hashes(clState->preferred_vwidth, &threads, &hashes, globalThreads,
|
set_threads_hashes(clState->preferred_vwidth, &threads, &hashes, globalThreads,
|
||||||
localThreads[0], gpu->intensity);
|
localThreads[0], gpu->intensity);
|
||||||
|
if (hashes > gpu->max_hashes)
|
||||||
|
gpu->max_hashes = hashes;
|
||||||
status = thrdata->queue_kernel_parameters(clState, &work->blk);
|
status = thrdata->queue_kernel_parameters(clState, &work->blk);
|
||||||
if (unlikely(status != CL_SUCCESS)) {
|
if (unlikely(status != CL_SUCCESS)) {
|
||||||
applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
|
applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
|
||||||
@ -1259,7 +1263,10 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
work->blk.nonce += hashes;
|
/* The amount of work scanned can fluctuate when intensity changes
|
||||||
|
* and since we do this one cycle behind, we increment the work more
|
||||||
|
* than enough to prevent repeating work */
|
||||||
|
work->blk.nonce += gpu->max_hashes;
|
||||||
|
|
||||||
return hashes;
|
return hashes;
|
||||||
}
|
}
|
||||||
|
3
miner.h
3
miner.h
@ -228,9 +228,10 @@ struct cgpu_info {
|
|||||||
int threads;
|
int threads;
|
||||||
struct thr_info *thread;
|
struct thr_info *thread;
|
||||||
|
|
||||||
|
unsigned int max_hashes;
|
||||||
int virtual_gpu;
|
int virtual_gpu;
|
||||||
bool dynamic;
|
|
||||||
int intensity;
|
int intensity;
|
||||||
|
bool dynamic;
|
||||||
|
|
||||||
float temp;
|
float temp;
|
||||||
int cutofftemp;
|
int cutofftemp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user