[Beignet] [PATCH] utests: fix two utest bugs.

He Junyan junyan.he at inbox.com
Mon Sep 1 22:31:26 PDT 2014


That OK

On 二, 2014-09-02 at 10:36 +0800, Zhigang Gong wrote:
> Similar as the bug found by junyan, some events are
> accessed before assigned.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  utests/runtime_event.cpp       | 2 +-
>  utests/runtime_marker_list.cpp | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utests/runtime_event.cpp b/utests/runtime_event.cpp
> index b974f6a..f8170a3 100644
> --- a/utests/runtime_event.cpp
> +++ b/utests/runtime_event.cpp
> @@ -28,7 +28,7 @@ void runtime_event(void)
>    locals[0] = 32;
>    clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globals, locals, 2, &ev[0], &ev[2]);
>  
> -  for (cl_uint i = 0; i != sizeof(ev) / sizeof(cl_event); ++i) {
> +  for (cl_uint i = 0; i < 3; ++i) {
>      clGetEventInfo(ev[i], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
>      OCL_ASSERT(status >= CL_SUBMITTED);
>    }
> diff --git a/utests/runtime_marker_list.cpp b/utests/runtime_marker_list.cpp
> index fc77156..f64b1d1 100644
> --- a/utests/runtime_marker_list.cpp
> +++ b/utests/runtime_marker_list.cpp
> @@ -34,7 +34,7 @@ void runtime_marker_list(void)
>  
>    clEnqueueNDRangeKernel(queue, kernel, 1, NULL, globals, locals, 2, &ev[0], &ev[2]);
>  
> -  for (cl_uint i = 0; i != sizeof(ev) / sizeof(cl_event); ++i) {
> +  for (cl_uint i = 0; i < 3; ++i) {
>      clGetEventInfo(ev[i], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
>      OCL_ASSERT(status >= CL_SUBMITTED);
>    }





More information about the Beignet mailing list