Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problem to measure kernel time in Cloo

Help
Pablitinho
2012-11-20
2012-12-21
  • Pablitinho
    Pablitinho
    2012-11-20

    Hi there,
    When I measure the execution time with events I have a big delay in the normal execution of the code (in relation if I dont measure the time with the event), but seems that the time is measured right. Below is show the code:

    //----------------------------------------------------------------------------------------------
    // Code with event time measurement
    //----------------------------------------------------------------------------------------------
    ev.Clear();
    GPUDevice.oclCQ.Execute(Kernels.myKernel, null, GlobalWorkSize, LocalWorkSize, ev);
    GPUDevice.oclCQ.Finish();
    GPUDevice.oclCQ.Wait(ev);

    long  start = ev.Last.StartTime;
    long   end = ev.Last.FinishTime;

    float Time= (float)((end - start) / 1000000.0f);
    //----------------------------------------------------------------------------------------------

    //----------------------------------------------------------------------------------------------
    // Code without event time measurement
    //----------------------------------------------------------------------------------------------
    sw.Reset();
    sw.Start();
    GPUDevice.oclCQ.Execute(Kernels.myKernel, null, GlobalWorkSize, LocalWorkSize, null);
    GPUDevice.oclCQ.Finish();
    sw.Stop();
    float Time = (float)sw.Elapsed.TotalMilliseconds;

    //----------------------------------------------------------------------------------------------

    Anyone know the reason of this?.
    Thx in advance !!!!!!

     

  • Anonymous
    2012-11-28

    From what I know events are quite slow generally (which is not caused by Cloo itself). I've never used events, but that's what I've heard about in different places. So it seems your observed behaviour is perfectly normal! ;)