diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2014-09-02 10:34:33 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-09-02 12:52:22 +0800 |
commit | 206adf62acd93d85f7e139a2bcf5dab3e2449c1d (patch) | |
tree | 79a9a00505171d5f5e5fad767a2647d22c60b12c | |
parent | 6efa7a20646f676cebb8c5c20f7a7b301f9aad7a (diff) |
utests: fix two utest bugs.
Similar as the bug found by junyan, some events are
accessed before assigned.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: He Junyan <junyan.he@inbox.com>
-rw-r--r-- | utests/runtime_event.cpp | 2 | ||||
-rw-r--r-- | 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); } |