[v2] GetEventProfilingInfo could query all event status.

Submitted by Luo, Xionghu on Aug. 4, 2015, 5:11 a.m.

Details

Message ID 1438665070-20329-1-git-send-email-xionghu.luo@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Luo, Xionghu Aug. 4, 2015, 5:11 a.m.
From: Luo Xionghu <xionghu.luo@intel.com>

this could fix the shoc project reported CL_PROFILING_INFO_NOT_AVAILABLE
issue.
https://github.com/vetter/shoc/issues/47
v2: per spec, the GetEventProfilingInfo need return
CL_PROFILING_INFO_NOT_AVAILABLE if the event is not CL_COMPLETE, so the
event should be updated in clFinish.

Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
---
 src/cl_command_queue.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c
index 4e4ebfb..4b92311 100644
--- a/src/cl_command_queue.c
+++ b/src/cl_command_queue.c
@@ -276,6 +276,9 @@  LOCAL cl_int
 cl_command_queue_finish(cl_command_queue queue)
 {
   cl_gpgpu_sync(cl_get_thread_batch_buf(queue));
+  cl_event last_event = get_last_event(queue);
+  if (last_event)
+    cl_event_update_status(last_event, 1);
   return CL_SUCCESS;
 }