[Mesa-dev] [PATCH] clover: block on transfer api calls when requested
Zoltan Gilian
zoltan.gilian at gmail.com
Sat Aug 15 07:28:55 PDT 2015
---
src/gallium/state_trackers/clover/api/transfer.cpp | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/gallium/state_trackers/clover/api/transfer.cpp b/src/gallium/state_trackers/clover/api/transfer.cpp
index cd3bd00..c2c8af2 100644
--- a/src/gallium/state_trackers/clover/api/transfer.cpp
+++ b/src/gallium/state_trackers/clover/api/transfer.cpp
@@ -311,6 +311,9 @@ clEnqueueReadBuffer(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
&mem, obj_origin, obj_pitch,
region));
+ if (blocking)
+ hev().wait();
+
ret_object(rd_ev, hev);
return CL_SUCCESS;
@@ -341,6 +344,9 @@ clEnqueueWriteBuffer(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
ptr, {}, obj_pitch,
region));
+ if (blocking)
+ hev().wait();
+
ret_object(rd_ev, hev);
return CL_SUCCESS;
@@ -378,6 +384,9 @@ clEnqueueReadBufferRect(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
&mem, obj_origin, obj_pitch,
region));
+ if (blocking)
+ hev().wait();
+
ret_object(rd_ev, hev);
return CL_SUCCESS;
@@ -415,6 +424,9 @@ clEnqueueWriteBufferRect(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
ptr, host_origin, host_pitch,
region));
+ if (blocking)
+ hev().wait();
+
ret_object(rd_ev, hev);
return CL_SUCCESS;
@@ -520,6 +532,9 @@ clEnqueueReadImage(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
&img, src_origin, src_pitch,
region));
+ if (blocking)
+ hev().wait();
+
ret_object(rd_ev, hev);
return CL_SUCCESS;
@@ -553,6 +568,8 @@ clEnqueueWriteImage(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking,
soft_copy_op(q, &img, dst_origin, dst_pitch,
ptr, {}, src_pitch,
region));
+ if (blocking)
+ hev().wait();
ret_object(rd_ev, hev);
return CL_SUCCESS;
--
2.4.6
More information about the mesa-dev
mailing list