did you enable profiling when you create command queue?
%d in printf expect 32 bit int. use %llu instead.
Originally posted by: pavandsp
Times returned by profiler are expressed in nanoseconds (10^-9 sec.), that's why you see those values. After you do endtime-starttime you have to scale the result in seconds.
Originally posted by: pavandsp Hi
I am trying to profile a simple (for loop)code in OpenCL.
I used clGetEventProfilingInfo to get the start and end time.But i am getting weired values start time=-1775338701 ,end time=19927,and the diff=start-end=1046102520 and the param_value_size_ret=19939.
I called the api clGetEventProfilingInfo after clEnqueueNDRangekernel and clwaitForevents apis.
My Config=Linux Ubuntu 9.04,Intel CPU.
My Question is :1.How come start time is -ve
psuedo profile code:
clGetEventProfilingInfo (events,CL_PROFILING_COMMAND_END,sizeof(cl_ulong,&end time,&length));
cl_ulong diff=endtime-start time;
printf("start time=%d end =%d diff=%d length=%d",start,end ,diff,length);
Could you please post test case which shows the problem?
Do i need to do something in kernel file?
Nothing is required in kernel file.