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 <currojerez@riseup.net>
This commit is contained in:
Tom Stellard 2012-09-17 14:29:49 +00:00
parent 0e3c30cd6f
commit 71682cf65b
3 changed files with 9 additions and 1 deletions

View file

@ -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,
dev->max_mem_alloc_size());
case CL_DEVICE_IMAGE2D_MAX_WIDTH:
case CL_DEVICE_IMAGE2D_MAX_HEIGHT:

View file

@ -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<uint64_t>(pipe,
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE)[0];
}
std::vector<size_t>
_cl_device_id::max_block_size() const {
auto v = get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);

View file

@ -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<size_t> max_block_size() const;
std::string device_name() const;