[Beignet] [Patch V2] BDW: Change the default tiling mode to TILING_Y on BDW.

Zhigang Gong zhigang.gong at linux.intel.com
Thu Nov 20 20:31:54 PST 2014


This patch LGTM, will push latter. Thanks.

On Wed, Nov 19, 2014 at 01:20:41PM +0800, Yang Rong wrote:
> TILING_Y's performance is better than TILING_X'S on BDW, but almost same
> on IVB/HSW. Using the TILING_Y as default tiling mode temporary, still need
> to find out the root cause why different behavior between BDW and IVB/HSW.
> 
> V2: still using static and only initialize once.
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
>  src/cl_mem.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/cl_mem.c b/src/cl_mem.c
> index d60c59b..3323897 100644
> --- a/src/cl_mem.c
> +++ b/src/cl_mem.c
> @@ -637,11 +637,15 @@ cl_mem_copy_image(struct _cl_mem_image *image,
>    cl_mem_unmap_auto((cl_mem)image);
>  }
>  
> -cl_image_tiling_t cl_get_default_tiling(void)
> +cl_image_tiling_t cl_get_default_tiling(cl_driver drv)
>  {
>    static int initialized = 0;
>    static cl_image_tiling_t tiling = CL_TILE_X;
> +
>    if (!initialized) {
> +    // FIXME, need to find out the performance diff's root cause on BDW.
> +    if(cl_driver_get_ver(drv) == 8)
> +      tiling = CL_TILE_Y;
>      char *tilingStr = getenv("OCL_TILING");
>      if (tilingStr != NULL) {
>        switch (tilingStr[0]) {
> @@ -733,7 +737,7 @@ _cl_mem_new_image(cl_context ctx,
>  
>      /* Pick up tiling mode (we do only linear on SNB) */
>      if (cl_driver_get_ver(ctx->drv) != 6)
> -      tiling = cl_get_default_tiling();
> +      tiling = cl_get_default_tiling(ctx->drv);
>  
>      depth = 1;
>    } else if (image_type == CL_MEM_OBJECT_IMAGE3D ||
> @@ -743,7 +747,7 @@ _cl_mem_new_image(cl_context ctx,
>        h = 1;
>        tiling = CL_NO_TILE;
>      } else if (cl_driver_get_ver(ctx->drv) != 6)
> -      tiling = cl_get_default_tiling();
> +      tiling = cl_get_default_tiling(ctx->drv);
>  
>      size_t min_pitch = bpp * w;
>      if (data && pitch == 0)
> -- 
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list