[Beignet] [PATCH V2 2/2] Change event test case to cover clEnqueueMapBuffer.
Yang Rong
rong.r.yang at intel.com
Thu Aug 22 20:04:22 PDT 2013
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
utests/runtime_event.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/utests/runtime_event.cpp b/utests/runtime_event.cpp
index 1ec8692..b974f6a 100644
--- a/utests/runtime_event.cpp
+++ b/utests/runtime_event.cpp
@@ -33,6 +33,8 @@ void runtime_event(void)
OCL_ASSERT(status >= CL_SUBMITTED);
}
+ buf_data[0] = clEnqueueMapBuffer(queue, buf[0], CL_TRUE, 0, 0, BUFFERSIZE*sizeof(int), 1, &ev[2], NULL, NULL);
+
OCL_SET_USER_EVENT_STATUS(ev[0], CL_COMPLETE);
clGetEventInfo(ev[0], CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(status), &status, NULL);
@@ -45,13 +47,10 @@ void runtime_event(void)
OCL_ASSERT(status <= CL_COMPLETE);
}
- // Check results
- OCL_MAP_BUFFER(0);
-
for (uint32_t i = 0; i < n; ++i) {
OCL_ASSERT(((int*)buf_data[0])[i] == (int)value + 0x3);
}
- OCL_UNMAP_BUFFER(0);
+ clEnqueueUnmapMemObject(queue, buf[0], buf_data[0], 0, NULL, NULL);
for (cl_uint i = 0; i != sizeof(ev) / sizeof(cl_event); ++i) {
clReleaseEvent(ev[i]);
--
1.8.1.2
More information about the Beignet
mailing list