[Beignet] [PATCH 1/5] Runtime: should initialize ptr when do clEnqueueWriteImage.

Zhigang Gong zhigang.gong at linux.intel.com
Fri Sep 6 01:40:23 PDT 2013


The previous code was using ptr as read buffer pointer which is never
initialized. So I wrote this patch to fix that. After check your patch
this morning, I got to know that you wanted to use const_ptr as read
buffer and ptr as writing buffer. I'm ok with your patch, and please
ignore this one.

BTW, ptr/const_ptr is not a good name, which I think somehow is the
reason why you used the wrong pointer at the first time. :).


On Fri, Sep 06, 2013 at 07:33:11AM +0000, Yang, Rong R wrote:
> Hi, Zhigang,
> 
>   clEnqueueWriteImage using data->const_ptr, so need not initialize data->ptr.
>   There is a bug in function cl_enqueue_write_image, I has fixed it by the morning's patch.
> 
> -----Original Message-----
> From: beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org [mailto:beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org] On Behalf Of Zhigang Gong
> Sent: Friday, September 06, 2013 1:43 PM
> To: beignet at lists.freedesktop.org
> Cc: Zhigang Gong
> Subject: [Beignet] [PATCH 1/5] Runtime: should initialize ptr when do clEnqueueWriteImage.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
> ---
>  src/cl_api.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/cl_api.c b/src/cl_api.c index 30d0b11..7fe736e 100644
> --- a/src/cl_api.c
> +++ b/src/cl_api.c
> @@ -1507,6 +1507,7 @@ clEnqueueWriteImage(cl_command_queue     command_queue,
>    data->region[0]   = region[0];  data->region[1] = region[1];  data->region[2] = region[2];
>    data->row_pitch   = row_pitch;
>    data->slice_pitch = slice_pitch;
> +  data->ptr = ptr;
>  
>    if(handle_events(command_queue, num_events_in_wait_list, event_wait_list,
>                     event, data, CL_COMMAND_WRITE_IMAGE) == CL_ENQUEUE_EXECUTE_IMM) {
> --
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list