[Beignet] [PATCH] runtime: disable userptr due to random fail.

Zhigang Gong zhigang.gong at intel.com
Wed Nov 12 21:54:29 PST 2014


We get a random fail when enable userptr. Disable it before
we root cause and fix it.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 src/cl_device_id.c | 7 +++++--
 src/cl_gt_device.h | 4 ----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index 522c3c5..6990e19 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -402,6 +402,7 @@ brw_gt3_break:
     }
   }
 
+#if 0
 #ifdef HAS_USERPTR
   cl_driver dummy = cl_driver_new(NULL);
   cl_buffer_mgr bufmgr = cl_driver_get_bufmgr(dummy);
@@ -413,15 +414,17 @@ brw_gt3_break:
     cl_buffer bo = cl_buffer_alloc_userptr(bufmgr, "CL memory object", host_ptr, sz, 0);
     if (bo == NULL)
       ret->host_unified_memory = CL_FALSE;
-    else
+    else {
       cl_buffer_unreference(bo);
+      ret->host_unified_memory = CL_TRUE;
+    }
     free(host_ptr);
   }
   else
     ret->host_unified_memory = CL_FALSE;
   cl_driver_delete(dummy);
 #endif
-
+#endif
   return ret;
 }
 
diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h
index 37abfd2..b80970c 100644
--- a/src/cl_gt_device.h
+++ b/src/cl_gt_device.h
@@ -60,11 +60,7 @@
 .max_constant_buffer_size = 512 << 10,
 .max_constant_args = 8,
 .error_correction_support = CL_FALSE,
-#ifdef HAS_USERPTR
-.host_unified_memory = CL_TRUE,
-#else
 .host_unified_memory = CL_FALSE,
-#endif
 .profiling_timer_resolution = 80, /* ns */
 .endian_little = CL_TRUE,
 .available = CL_TRUE,
-- 
1.8.3.2



More information about the Beignet mailing list