[Mesa-dev] [PATCH 1/3] clover: Default to required minimum for CL_DEVICE_MAX_MEM_ALLOC_SIZE

Tom Stellard tom at stellard.net
Mon Sep 17 14:01:06 PDT 2012


From: Tom Stellard <thomas.stellard at amd.com>

---
 src/gallium/state_trackers/clover/api/device.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 1a9127b..636bdc0 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -126,7 +126,8 @@ clGetDeviceInfo(cl_device_id dev, cl_device_info param,
                                       dev->max_images_write());
 
    case CL_DEVICE_MAX_MEM_ALLOC_SIZE:
-      return scalar_property<cl_ulong>(buf, size, size_ret, 0);
+      return scalar_property<cl_ulong>(buf, size, size_ret,
+             std::max(dev->max_mem_global() / 4, (cl_ulong)(128 * 1024 * 1024)));
 
    case CL_DEVICE_IMAGE2D_MAX_WIDTH:
    case CL_DEVICE_IMAGE2D_MAX_HEIGHT:
-- 
1.7.11.4



More information about the mesa-dev mailing list