hi Folks,
I am trying to measure the execution time of a command using profiling info.
This is my code
cl_event profEvent;
cl_ulong timeStart,timeStop;
ciErr=clEnqueueNDRangeKernel(cqCommandQueue,ckKernel,1,NULL,&szGlobalWorkSize,NULL,0,NULL,profEvent);
ciErr=clWaitForEvents(1,&profEvent);
clGetEventProfilingInfo(profEvent,CL_PROFILING_COMMAND_END,sizeof(timeStop),&timeStop,NULL);
clGetEventProfilingInfo(profEvent,CL_PROFILING_COMMAND_START,sizeof(timeStart),&timeStart,NULL);
printf("
start=%ld",timeStart);
printf("
stop=%ld",timeStop);
printf("
Time after profiling in SUB is %Ld",timeStart-timeStop);
As per the stuff found over net, this should work fine, but I am getting the following output
start=6492816
stop=0
Time after profiling in SUB is 6492816
error -58 in NDRANget
Now -58 indicates invalid event and I am unable to figure this thing out how to get the event working?
Please show me how to correct this problem?
Thanks
Piyush