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

Zhao Yakui yakui.zhao at intel.com
Tue Nov 3 18:37:33 PST 2015


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



More information about the Beignet mailing list