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;
Anyone know the reason of this?.
Thx in advance !!!!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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! ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
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;
//----------------------------------------------------------------------------------------------
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! ;)