From 1dd40c40d0cbfc0d2e56733f2d7e4fc2a8d9d7dd Mon Sep 17 00:00:00 2001 From: Daniil Efremov Date: Fri, 27 Jan 2017 17:22:39 +0700 Subject: [PATCH] Mali GPU does not support host unified memory in fact #53 - as solution provided compilation param DISABLE_DEVICE_HOST_UNIFIED_MEMORY to force disabling support host unified memory --- src/caffe/device.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/caffe/device.cpp b/src/caffe/device.cpp index 7ee48963877..2581d6dd426 100644 --- a/src/caffe/device.cpp +++ b/src/caffe/device.cpp @@ -50,12 +50,18 @@ void device::Init() { workgroup_sizes_[0] = temp[0]; workgroup_sizes_[1] = temp[1]; workgroup_sizes_[2] = temp[2]; + +#ifdef DISABLE_DEVICE_HOST_UNIFIED_MEMORY + host_unified_ = false; + LOG(INFO) << "CL_DEVICE_HOST_UNIFIED_MEMORY: disabled"; +#else cl_bool host_unified; clGetDeviceInfo(ctx.devices()[0].id(), CL_DEVICE_HOST_UNIFIED_MEMORY, sizeof(cl_bool), &host_unified, NULL); - + LOG(INFO) << "CL_DEVICE_HOST_UNIFIED_MEMORY: " << host_unified; host_unified_ = host_unified; +#endif // DISABLE_DEVICE_HOST_UNIFIED_MEMORY SetProgram(); for (int q = 0; q < GREENTEA_QUEUE_COUNT - 1; ++q) {