summaryrefslogtreecommitdiff
path: root/utests/runtime_marker_list.cpp
diff options
context:
space:
mode:
authorJunyan He <junyan.he@intel.com>2016-09-21 17:47:23 +0800
committerYang Rong <rong.r.yang@intel.com>2016-09-28 15:59:55 +0800
commit6483fb4bf4cd0f9e4d29760c7bb1494cf02a84ce (patch)
treeca4bf2c68f5a7f81c79fc217bb95e4eb5f184408 /utests/runtime_marker_list.cpp
parent87c6eb4f4a083e6d9ed69cd6b4160684205e6194 (diff)
downloadbeignet-6483fb4bf4cd0f9e4d29760c7bb1494cf02a84ce.tar.gz
Fix bugs in utest for event.
The block api should make sure all its wait list will become ready, or we will hang. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/runtime_marker_list.cpp')
-rw-r--r--utests/runtime_marker_list.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/utests/runtime_marker_list.cpp b/utests/runtime_marker_list.cpp
index 751f4a03..b4e6edb7 100644
--- a/utests/runtime_marker_list.cpp
+++ b/utests/runtime_marker_list.cpp
@@ -23,7 +23,7 @@ void runtime_marker_list(void)
OCL_CREATE_USER_EVENT(ev[0]);
- clEnqueueWriteBuffer(queue, buf[0], CL_TRUE, 0, BUFFERSIZE*sizeof(int), (void *)cpu_src, 1, &ev[0], &ev[1]);
+ clEnqueueWriteBuffer(queue, buf[0], CL_FALSE, 0, BUFFERSIZE*sizeof(int), (void *)cpu_src, 1, &ev[0], &ev[1]);
OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
OCL_SET_ARG(1, sizeof(int), &value);
@@ -40,23 +40,22 @@ void runtime_marker_list(void)
}
- buf_data[0] = clEnqueueMapBuffer(queue, buf[0], CL_TRUE, 0, 0, BUFFERSIZE*sizeof(int), 1, &ev[2], NULL, NULL);
+ buf_data[0] = clEnqueueMapBuffer(queue, buf[0], CL_FALSE, 0, 0, BUFFERSIZE*sizeof(int), 1, &ev[2], NULL, NULL);
clEnqueueMarkerWithWaitList(queue, 0, NULL, &ev[3]);
- clEnqueueWriteBuffer(queue, buf[1], CL_TRUE, 0, BUFFERSIZE*sizeof(int), (void *)cpu_src_2, 0, NULL, &ev[4]);
+ clEnqueueWriteBuffer(queue, buf[1], CL_FALSE, 0, BUFFERSIZE*sizeof(int), (void *)cpu_src_2, 1, &ev[3], &ev[4]);
- OCL_FINISH();
clGetEventInfo(ev[4], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
- OCL_ASSERT(status == CL_COMPLETE);
+ OCL_ASSERT(status != CL_COMPLETE);
OCL_SET_USER_EVENT_STATUS(ev[0], CL_COMPLETE);
+ OCL_FINISH();
+
clGetEventInfo(ev[0], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
OCL_ASSERT(status == CL_COMPLETE);
- OCL_FINISH();
-
for (cl_uint i = 0; i != sizeof(ev) / sizeof(cl_event); ++i) {
clGetEventInfo(ev[i], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
OCL_ASSERT(status <= CL_COMPLETE);