Browse Source

Check for gpu return times of >= 0, not just 0, to fix intensity dropping to -10.

nfactor-troky
ckolivas 13 years ago
parent
commit
66e7dc700d
  1. 5
      driver-opencl.c

5
driver-opencl.c

@ -1355,6 +1355,7 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
unsigned int hashes; unsigned int hashes;
/* This finish flushes the readbuffer set with CL_FALSE later */ /* This finish flushes the readbuffer set with CL_FALSE later */
gettimeofday(&gpu->tv_gpustart, NULL);
clFinish(clState->commandQueue); clFinish(clState->commandQueue);
gettimeofday(&gpu->tv_gpuend, NULL); gettimeofday(&gpu->tv_gpuend, NULL);
@ -1364,7 +1365,7 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
timersub(&gpu->tv_gpuend, &gpu->tv_gpustart, &diff); timersub(&gpu->tv_gpuend, &gpu->tv_gpustart, &diff);
gpu_us = diff.tv_sec * 1000000 + diff.tv_usec; gpu_us = diff.tv_sec * 1000000 + diff.tv_usec;
if (likely(gpu_us > 0)) { if (likely(gpu_us >= 0)) {
gpu->gpu_us_average = (gpu->gpu_us_average + gpu_us * 0.63) / 1.63; gpu->gpu_us_average = (gpu->gpu_us_average + gpu_us * 0.63) / 1.63;
/* Try to not let the GPU be out for longer than /* Try to not let the GPU be out for longer than
@ -1410,8 +1411,6 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work,
clFinish(clState->commandQueue); clFinish(clState->commandQueue);
} }
gettimeofday(&gpu->tv_gpustart, NULL);
if (clState->goffset) { if (clState->goffset) {
size_t global_work_offset[1]; size_t global_work_offset[1];

Loading…
Cancel
Save