Fix a bug for runtime_barrier_list.cpp, event array out of bound
authorJunyan He <junyan.he@linux.intel.com>
Tue, 2 Sep 2014 02:37:02 +0000 (10:37 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Tue, 2 Sep 2014 02:06:55 +0000 (10:06 +0800)
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
utests/runtime_barrier_list.cpp

index 6987d5e..135996f 100644 (file)
@@ -34,7 +34,7 @@ void runtime_barrier_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);
   }