[Mesa-dev] [PATCH] clover: block on transfer api calls when requested
--- 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 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] clover: block on transfer api calls when requested
v2: Fix whitespace error. --- src/gallium/state_trackers/clover/api/transfer.cpp | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/gallium/state_trackers/clover/api/transfer.cpp b/src/gallium/state_trackers/clover/api/transfer.cpp index cd3bd00..274c45a 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; @@ -554,6 +569,9 @@ clEnqueueWriteImage(cl_command_queue d_q, cl_mem d_mem, cl_bool blocking, ptr, {}, src_pitch, region)); + if (blocking) + hev().wait(); + ret_object(rd_ev, hev); return CL_SUCCESS; -- 2.4.6 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] clover: block on transfer api calls when requested
Hello This looks like what I've send a few weeks ago [0]. It's seems we should come with something a little different as explain by curro in [1] [0] http://lists.freedesktop.org/archives/mesa-dev/2015-August/090479.html [1] http://lists.freedesktop.org/archives/mesa-dev/2015-June/086110.html EdB On Saturday 15 August 2015 16:28:55 Zoltan Gilian wrote: > --- > 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; ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] clover: block on transfer api calls when requested
On Sat, Aug 15, 2015 at 10:20 PM, Serge Martin (EdB) wrote: > This looks like what I've send a few weeks ago [0]. It's seems we should come > with something a little different as explain by curro in [1] Ok, didn't notice that :) Sorry for the duplicate. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev