runtime: fix event status check bug.

Submitted by Luo, Xionghu on July 29, 2015, 2:21 a.m.

Details

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

Not browsing as part of any series.

Commit Message

Luo, Xionghu July 29, 2015, 2:21 a.m.
From: Luo <xionghu.luo@intel.com>

clGetEventProfilingInfo could query all event status.
this could fix the shoc project reported CL_PROFILING_INFO_NOT_AVAILABLE
issue.
https://github.com/vetter/shoc/issues/47

Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
---
 src/cl_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/cl_api.c b/src/cl_api.c
index 28783fd..0ac7112 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -1472,7 +1472,7 @@  clGetEventProfilingInfo(cl_event             event,
 
   if (event->type == CL_COMMAND_USER ||
       !(event->queue->props & CL_QUEUE_PROFILING_ENABLE) ||
-          event->status != CL_COMPLETE) {
+       event->status < CL_COMPLETE || event->status > CL_QUEUED) {
     err = CL_PROFILING_INFO_NOT_AVAILABLE;
     goto error;
   }

Comments

Although clGetEventProfilingInfo could get CL_PROFILING_COMMAND_QUEUED and other times, but them seems only available after the event finished.

CL_PROFILING_INFO_NOT_AVAILABLE if the CL_QUEUE_PROFILING_ENABLE flag
is not set for the command-queue, if the execution status of the command identified by
event is not CL_COMPLETE or if event is a user event object.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> xionghu.luo@intel.com

> Sent: Wednesday, July 29, 2015 10:22

> To: beignet@lists.freedesktop.org

> Cc: Luo, Xionghu

> Subject: [Beignet] [PATCH] runtime: fix event status check bug.

> 

> From: Luo <xionghu.luo@intel.com>

> 

> clGetEventProfilingInfo could query all event status.

> this could fix the shoc project reported

> CL_PROFILING_INFO_NOT_AVAILABLE issue.

> https://github.com/vetter/shoc/issues/47

> 

> Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>

> ---

>  src/cl_api.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/src/cl_api.c b/src/cl_api.c index 28783fd..0ac7112 100644

> --- a/src/cl_api.c

> +++ b/src/cl_api.c

> @@ -1472,7 +1472,7 @@ clGetEventProfilingInfo(cl_event             event,

> 

>    if (event->type == CL_COMMAND_USER ||

>        !(event->queue->props & CL_QUEUE_PROFILING_ENABLE) ||

> -          event->status != CL_COMPLETE) {

> +       event->status < CL_COMPLETE || event->status > CL_QUEUED) {

>      err = CL_PROFILING_INFO_NOT_AVAILABLE;

>      goto error;

>    }

> --

> 1.9.1

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/beignet