@@ -757,10 +757,8 @@ static int intel_buffer_set_tiling(cl_buffer bo,
static void
intel_update_device_info(cl_device_id device)
{
-#ifdef HAS_USERPTR
intel_driver_t *driver;
- const size_t sz = 4096;
- void *host_ptr;
+ unsigned int eu_total, subslice_total;
driver = intel_driver_new();
assert(driver != NULL);
@@ -769,6 +767,10 @@ intel_update_device_info(cl_device_id device)
return;
}
+#ifdef HAS_USERPTR
+ const size_t sz = 4096;
+ void *host_ptr;
+
host_ptr = cl_aligned_malloc(sz, 4096);
if (host_ptr != NULL) {
cl_buffer bo = intel_buffer_alloc_userptr((cl_buffer_mgr)driver->bufmgr,
@@ -781,12 +783,18 @@ intel_update_device_info(cl_device_id device)
}
else
device->host_unified_memory = CL_FALSE;
+#endif
+
+ /* Prefer driver-queried value if supported */
+ if (!drm_intel_get_eu_total(driver->fd, &eu_total))
+ device->max_compute_unit = eu_total;
+ if (!drm_intel_get_subslice_total(driver->fd, &subslice_total))
+ device->sub_slice_count = subslice_total;
intel_driver_context_destroy(driver);
intel_driver_close(driver);
intel_driver_terminate(driver);
intel_driver_delete(driver);
-#endif
}
LOCAL void