Browse Source

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.

nfactor-troky
ckolivas 13 years ago
parent
commit
79a4e25742
  1. 5
      driver-opencl.c

5
driver-opencl.c

@ -1353,7 +1353,6 @@ static uint64_t opencl_scanhash(struct thr_info *thr, struct work *work, @@ -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, @@ -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, @@ -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…
Cancel
Save