mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Opencl code may start executing before the clfinish order is given to it so get the start timing used for dynamic intensity from before the kernel is queued.
This commit is contained in:
parent
b2cef11480
commit
79a4e25742
@ -1353,7 +1353,6 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
||||
unsigned int threads;
|
||||
unsigned int hashes;
|
||||
|
||||
gettimeofday(&gpu->tv_gpustart, NULL);
|
||||
/* This finish flushes the readbuffer set with CL_FALSE later */
|
||||
clFinish(clState->commandQueue);
|
||||
gettimeofday(&gpu->tv_gpuend, NULL);
|
||||
@ -1372,7 +1371,7 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
||||
if (gpu->gpu_ms_average > opt_dynamic_interval) {
|
||||
if (gpu->intensity > MIN_INTENSITY)
|
||||
--gpu->intensity;
|
||||
} else if (gpu->gpu_ms_average < ((opt_dynamic_interval / 2) ? : 1)) {
|
||||
} else if (gpu->gpu_ms_average < (float)opt_dynamic_interval / 2) {
|
||||
if (gpu->intensity < MAX_INTENSITY)
|
||||
++gpu->intensity;
|
||||
}
|
||||
@ -1408,6 +1407,8 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
|
||||
clFinish(clState->commandQueue);
|
||||
}
|
||||
|
||||
gettimeofday(&gpu->tv_gpustart, NULL);
|
||||
|
||||
if (clState->goffset) {
|
||||
size_t global_work_offset[1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user