Fr4nz

Getting too short chrono times from OpenCL profiling...

Discussion created by Fr4nz on Jan 20, 2010
Latest reply on Jan 22, 2010 by Fr4nz

Hi,

I'm getting way too short chrono times when I profile the execution of my kernel (in the order of tenths of a second, when it should report seconds of execution).

The profiling code is report below here...did I make any error in the code?

I'm working under Ubuntu 9.04 32-bit, ATI 5770 and hotfix 9.12 drivers.

cl_ulong startTime, endTime; cl_event chronoEvent; errCode = clEnqueueNDRangeKernel(this->coda, this->kernel, 1, NULL, &totWorkItems, &dimWorkGroup, 0, NULL, &chronoEvent); if(errCode != CL_SUCCESS) printf("\nFallimento esecuzione kernel! %d", errCode); // Punto di sincronizzazione: prima di procedere con la lettura dei risultati, aspetto che // i vari work-item abbiano finito di lavorare; clFinish(this->coda); // Computo del tempo di esecuzione su GPU; // TODO: Computa tempi troppo brevi, da fixare! errCode = clGetEventProfilingInfo(chronoEvent, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &startTime, NULL); if(errCode != CL_SUCCESS) printf("\nFallimento profiling! %d", errCode); errCode = clGetEventProfilingInfo(chronoEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &endTime, NULL); if(errCode != CL_SUCCESS) printf("\nFallimento profiling! %d", errCode); double elapsedTime = (endTime-startTime); printf("\nTempo trascorso: %.3f", elapsedTime/1000000000); clReleaseEvent(chronoEvent);

Outcomes