[Beignet] [PATCH] save host_ptr when create sub buffer from CL_MEM_ALLOC_HOST_PTR

Guo, Yejun yejun.guo at intel.com
Thu Dec 1 05:42:10 UTC 2016


it fixes issue at https://bugs.freedesktop.org/show_bug.cgi?id=98490

Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
---
 src/cl_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cl_mem.c b/src/cl_mem.c
index 798daaf..afce315 100644
--- a/src/cl_mem.c
+++ b/src/cl_mem.c
@@ -636,7 +636,7 @@ cl_mem_new_sub_buffer(cl_mem buffer,
   mem->bo = buffer->bo;
   mem->size = info->size;
   sub_buf->sub_offset = info->origin;
-  if (buffer->flags & CL_MEM_USE_HOST_PTR || buffer->flags & CL_MEM_COPY_HOST_PTR) {
+  if (buffer->flags & CL_MEM_USE_HOST_PTR || buffer->flags & CL_MEM_COPY_HOST_PTR || buffer->flags & CL_MEM_ALLOC_HOST_PTR) {
     mem->host_ptr = buffer->host_ptr;
   }
 
-- 
1.9.1



More information about the Beignet mailing list