Hill_Groove

Time measuring for OpenCL kernels

Discussion created by Hill_Groove on Feb 23, 2010
Latest reply on Mar 1, 2010 by ryta1203
clock_t problem

Hello everyone,

I am using a clock_t class to get my code worktime. The attached code always returns zero kernel count time on Ubuntu, although on Win7 everything seems to be in order.

Is there any method to avoid this trouble and get the correct time? Thank You.

i7-860, 5870

clock_t start = clock(); .... gpu.SetKernelArgs(); gpu.RunKernel(); gpu.ReadKernelArg(6, RES, K*K*4); .... float Gworktime = (float) (clock() - start) / CLOCKS_PER_SEC;

Outcomes