[Beignet] [PATCH] Fix a bug for runtime_barrier_list.cpp, local var not inited.

Zhigang Gong zhigang.gong at linux.intel.com
Sun Aug 31 18:27:13 PDT 2014


I just checked the test case. This may not the best fix. The issue should be
the first time to access all the events which also inclues the uninitialized
event 3,4,5, And the following patch should be better.
-  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);
  }

Any thought?

On Mon, Sep 01, 2014 at 10:04:46AM +0800, junyan.he at inbox.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
> 
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
>  utests/runtime_barrier_list.cpp |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/utests/runtime_barrier_list.cpp b/utests/runtime_barrier_list.cpp
> index 6987d5e..e176771 100644
> --- a/utests/runtime_barrier_list.cpp
> +++ b/utests/runtime_barrier_list.cpp
> @@ -1,3 +1,4 @@
> +#include <string.h>
>  #include "utest_helper.hpp"
>  
>  #define BUFFERSIZE  32*1024
> @@ -10,6 +11,8 @@ void runtime_barrier_list(void)
>    cl_int status = 0;
>    cl_int value = 34;
>  
> +  memset(ev, 0, sizeof(cl_event)*5);
> +
>    // Setup kernel and buffers
>    OCL_CREATE_KERNEL("compiler_event");
>    OCL_CREATE_BUFFER(buf[0], 0, BUFFERSIZE*sizeof(int), NULL);
> -- 
> 1.7.9.5
> 
> 
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list