[Beignet] [PATCH] Remove the incorrect check of height alignment in 2D image + use_host_ptr

Guo, Yejun yejun.guo at intel.com
Wed Nov 4 00:28:38 PST 2015


Did you verify the patch with opencl conformance test, I'm almost sure that image array and image3d need this condition. This might not necessary for image2d, but need verification to avoid regression issue.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhao Yakui
Sent: Wednesday, November 04, 2015 10:38 AM
To: beignet at lists.freedesktop.org
Cc: Zhao, Yakui; Guo, Yejun
Subject: [Beignet] [PATCH] Remove the incorrect check of height alignment in 2D image + use_host_ptr

Currently it will reject the creation of image based on host_ptr if the height is not aligned. In fact this is wrong. And we can't pass the aligned height in image_desc. Otherwise the sampler doesn't work as expected because of padding height. It is enough if the image_row_pitch follows the aligned requirement of width.

Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/cl_mem.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/cl_mem.c b/src/cl_mem.c index ca3e76f..82e44ae 100644
--- a/src/cl_mem.c
+++ b/src/cl_mem.c
@@ -839,7 +839,6 @@ _cl_mem_new_image(cl_context ctx,
     int cacheline_size = 0;
     cl_get_device_info(ctx->device, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, sizeof(cacheline_size), &cacheline_size, NULL);
     if (ALIGN((unsigned long)data, cacheline_size) == (unsigned long)data &&
-        ALIGN(h, cl_buffer_get_tiling_align(ctx, CL_NO_TILE, 1)) == h &&
         ((image_type != CL_MEM_OBJECT_IMAGE3D && image_type != CL_MEM_OBJECT_IMAGE1D_ARRAY && image_type != CL_MEM_OBJECT_IMAGE2D_ARRAY) || pitch * h == slice_pitch)) {
       tiling = CL_NO_TILE;
       enableUserptr = 1;
--
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