From 71682cf65bd31aca96f0c84434fc57bcfdec89fc Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 17 Sep 2012 14:29:49 +0000 Subject: [PATCH] clover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2 v2: - Use driver reported values and don't correct them to the OpenCL required minimum. Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/api/device.cpp | 3 ++- src/gallium/state_trackers/clover/core/device.cpp | 6 ++++++ src/gallium/state_trackers/clover/core/device.hpp | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp index 1a9127bb3d5..d99aed8f564 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(buf, size, size_ret, 0); + return scalar_property(buf, size, size_ret, + dev->max_mem_alloc_size()); case CL_DEVICE_IMAGE2D_MAX_WIDTH: case CL_DEVICE_IMAGE2D_MAX_HEIGHT: diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index 2ab735d9a2a..d93a1f6ac6c 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -144,6 +144,12 @@ _cl_device_id::max_threads_per_block() const { pipe, PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK)[0]; } +cl_ulong +_cl_device_id::max_mem_alloc_size() const { + return get_compute_param(pipe, + PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE)[0]; +} + std::vector _cl_device_id::max_block_size() const { auto v = get_compute_param(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE); diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp index 9408083e479..5b92751cbcd 100644 --- a/src/gallium/state_trackers/clover/core/device.hpp +++ b/src/gallium/state_trackers/clover/core/device.hpp @@ -56,6 +56,7 @@ public: cl_ulong max_const_buffer_size() const; cl_uint max_const_buffers() const; size_t max_threads_per_block() const; + cl_ulong max_mem_alloc_size() const; std::vector max_block_size() const; std::string device_name() const; -- 2.30.2