Results 1 to 2 of 2

Thread: Profiling Info for a command?

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    11

    Profiling Info for a command?

    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,ckKern el,1,NULL,&szGlobalWorkSize,NULL,0,NULL,profEvent) ;
    ciErr=clWaitForEvents(1,&profEvent);
    clGetEventProfilingInfo(profEvent,CL_PROFILING_COM MAND_END,sizeof(timeStop),&timeStop,NULL);
    clGetEventProfilingInfo(profEvent,CL_PROFILING_COM MAND_START,sizeof(timeStart),&timeStart,NULL);
    printf("\nstart=%ld",timeStart);
    printf("\nstop=%ld",timeStop);
    printf("\nTime after profiling in SUB is \t\t%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

  2. #2
    Piyush,

    A couple of comments:

    - It looks like you are missing an ampersand in your clEnqueueNDRangeKernel call. The last parameter to that function is a pointer to a cl_event, not the cl_event directly.
    - Make sure you create the command queue with the CL_QUEUE_PROFILING_ENABLE flag. Perhaps you're already doing this already, just want to make sure...

    Hope this helps!

    Aaron

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •