In general, the memory layout between cpu/gpu should be exactly the same. As for this condition, it is for image array and 3d, caring about the slice_pitch.
-----Original Message----- From: Zhao, Yakui Sent: Thursday, November 05, 2015 8:36 AM To: Guo, Yejun Cc: [email protected] Subject: Re: [Beignet] [PATCH] Remove the incorrect check of height alignment in 2D image + use_host_ptr On 11/04/2015 04:28 PM, Guo, Yejun wrote: > 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. Sorry that I don't test with image array/image3d. But for the image array/image3d: I think that the correct check should be: (slice_pitch >= image_row_pitch * ALIGN(h, XXX) && slice_pitch % image_row_pitch == 0) In such case it is enough that the internal check uses the aligned height. But it doesn't make sense that the height in image_desc should be already aligned. How do you think? > > -----Original Message----- > From: Beignet [mailto:[email protected]] On Behalf > Of Zhao Yakui > Sent: Wednesday, November 04, 2015 10:38 AM > To: [email protected] > 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<[email protected]> > --- > 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 > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
