clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK
This is not necessarily the product of MAX_BLOCK_SIZE[i]. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:

committed by
Francisco Jerez

parent
ec848d2730
commit
5c9bccc97e
@@ -212,6 +212,11 @@ pipe_screen::get_compute_param.
|
|||||||
units. Value type: ``uint64_t []``.
|
units. Value type: ``uint64_t []``.
|
||||||
* ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE``: Maximum block size in thread
|
* ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE``: Maximum block size in thread
|
||||||
units. Value type: ``uint64_t []``.
|
units. Value type: ``uint64_t []``.
|
||||||
|
* ``PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK``: Maximum number of threads that
|
||||||
|
a single block can contain. Value type: ``uint64_t``.
|
||||||
|
This may be less than the product of the components of MAX_BLOCK_SIZE and is
|
||||||
|
usually limited by the number of threads that can be resident simultaneously
|
||||||
|
on a compute unit.
|
||||||
* ``PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE``: Maximum size of the GLOBAL
|
* ``PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE``: Maximum size of the GLOBAL
|
||||||
resource. Value type: ``uint64_t``.
|
resource. Value type: ``uint64_t``.
|
||||||
* ``PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE``: Maximum size of the LOCAL
|
* ``PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE``: Maximum size of the LOCAL
|
||||||
|
@@ -548,6 +548,7 @@ enum pipe_compute_cap
|
|||||||
PIPE_COMPUTE_CAP_GRID_DIMENSION,
|
PIPE_COMPUTE_CAP_GRID_DIMENSION,
|
||||||
PIPE_COMPUTE_CAP_MAX_GRID_SIZE,
|
PIPE_COMPUTE_CAP_MAX_GRID_SIZE,
|
||||||
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE,
|
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE,
|
||||||
|
PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK,
|
||||||
PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE,
|
PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE,
|
||||||
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
|
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
|
||||||
PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE,
|
PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE,
|
||||||
|
@@ -87,7 +87,8 @@ clGetDeviceInfo(cl_device_id dev, cl_device_info param,
|
|||||||
dev->max_block_size());
|
dev->max_block_size());
|
||||||
|
|
||||||
case CL_DEVICE_MAX_WORK_GROUP_SIZE:
|
case CL_DEVICE_MAX_WORK_GROUP_SIZE:
|
||||||
return scalar_property<size_t>(buf, size, size_ret, SIZE_MAX);
|
return scalar_property<size_t>(buf, size, size_ret,
|
||||||
|
dev->max_threads_per_block());
|
||||||
|
|
||||||
case CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR:
|
case CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR:
|
||||||
return scalar_property<cl_uint>(buf, size, size_ret, 16);
|
return scalar_property<cl_uint>(buf, size, size_ret, 16);
|
||||||
|
@@ -138,6 +138,12 @@ _cl_device_id::max_const_buffers() const {
|
|||||||
PIPE_SHADER_CAP_MAX_CONST_BUFFERS);
|
PIPE_SHADER_CAP_MAX_CONST_BUFFERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
_cl_device_id::max_threads_per_block() const {
|
||||||
|
return get_compute_param<uint64_t>(
|
||||||
|
pipe, PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK)[0];
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<size_t>
|
std::vector<size_t>
|
||||||
_cl_device_id::max_block_size() const {
|
_cl_device_id::max_block_size() const {
|
||||||
return get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
|
return get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
|
||||||
|
@@ -55,6 +55,7 @@ public:
|
|||||||
cl_ulong max_mem_input() const;
|
cl_ulong max_mem_input() const;
|
||||||
cl_ulong max_const_buffer_size() const;
|
cl_ulong max_const_buffer_size() const;
|
||||||
cl_uint max_const_buffers() const;
|
cl_uint max_const_buffers() const;
|
||||||
|
size_t max_threads_per_block() const;
|
||||||
|
|
||||||
std::vector<size_t> max_block_size() const;
|
std::vector<size_t> max_block_size() const;
|
||||||
std::string device_name() const;
|
std::string device_name() const;
|
||||||
|
Reference in New Issue
Block a user