[Mesa-dev] [PATCH] clover: block on transfer api calls when requested

Serge Martin (EdB) edb+mesa at sigluy.net
Sat Aug 15 13:20:36 PDT 2015


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;



More information about the mesa-dev mailing list