[Beignet] [PATCH 2/2] runtime: fix some image array related bugs.

He Junyan junyan.he at inbox.com
Tue Jun 17 21:48:15 PDT 2014


Thanks for find the problem.
I think the key point is that for array image it always uses the 
slice_pitch rather than the image_row_pitch.
This patch set is good for me.

As you mentioned, I will improve my utest case later, and you can
push my first 2 patches firstly to make your patch set work.


On Wed, 2014-06-18 at 10:25 +0800, Zhigang Gong wrote:
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  src/cl_api.c       | 5 ++++-
>  src/cl_device_id.c | 1 +
>  src/cl_device_id.h | 1 +
>  src/cl_gt_device.h | 1 +
>  4 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cl_api.c b/src/cl_api.c
> index 327f02b..d988881 100644
> --- a/src/cl_api.c
> +++ b/src/cl_api.c
> @@ -674,7 +674,10 @@ clGetSupportedImageFormats(cl_context         ctx,
>      err = CL_INVALID_VALUE;
>      goto error;
>    }
> -  if (UNLIKELY(image_type != CL_MEM_OBJECT_IMAGE2D &&
> +  if (UNLIKELY(image_type != CL_MEM_OBJECT_IMAGE1D &&
> +               image_type != CL_MEM_OBJECT_IMAGE1D_ARRAY &&
> +               image_type != CL_MEM_OBJECT_IMAGE2D_ARRAY &&
> +               image_type != CL_MEM_OBJECT_IMAGE2D &&
>                 image_type != CL_MEM_OBJECT_IMAGE3D)) {
>      err = CL_INVALID_VALUE;
>      goto error;
> diff --git a/src/cl_device_id.c b/src/cl_device_id.c
> index af8e90c..578b548 100644
> --- a/src/cl_device_id.c
> +++ b/src/cl_device_id.c
> @@ -363,6 +363,7 @@ cl_get_device_info(cl_device_id     device,
>      DECL_FIELD(IMAGE_SUPPORT, image_support)
>      DECL_FIELD(MAX_READ_IMAGE_ARGS, max_read_image_args)
>      DECL_FIELD(MAX_WRITE_IMAGE_ARGS, max_write_image_args)
> +    DECL_FIELD(IMAGE_MAX_ARRAY_SIZE, image_max_array_size)
>      DECL_FIELD(IMAGE2D_MAX_WIDTH, image2d_max_width)
>      DECL_FIELD(IMAGE2D_MAX_HEIGHT, image2d_max_height)
>      DECL_FIELD(IMAGE3D_MAX_WIDTH, image3d_max_width)
> diff --git a/src/cl_device_id.h b/src/cl_device_id.h
> index a5449a7..769bfd2 100644
> --- a/src/cl_device_id.h
> +++ b/src/cl_device_id.h
> @@ -51,6 +51,7 @@ struct _cl_device_id {
>    cl_uint  max_read_image_args;
>    cl_uint  max_write_image_args;
>    size_t   image2d_max_width;
> +  size_t   image_max_array_size;
>    size_t   image2d_max_height;
>    size_t   image3d_max_width;
>    size_t   image3d_max_height;
> diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h
> index b8bda5e..6d03123 100644
> --- a/src/cl_gt_device.h
> +++ b/src/cl_gt_device.h
> @@ -41,6 +41,7 @@
>  .image_support = CL_TRUE,
>  .max_read_image_args = 128,
>  .max_write_image_args = 8,
> +.image_max_array_size = 2048,
>  .image2d_max_width = 8192,
>  .image2d_max_height = 8192,
>  .image3d_max_width = 8192,





More information about the Beignet mailing list