``processor-arch-manufacturer-os`` that will be passed on to the compiler.
This CAP is only relevant for drivers that specify PIPE_SHADER_IR_LLVM
or PIPE_SHADER_IR_NATIVE for their preferred IR.
- Value type: null-terminated string.
+ Value type: null-terminated string. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_GRID_DIMENSION``: Number of supported dimensions
- for grid and block coordinates. Value type: ``uint64_t``.
+ for grid and block coordinates. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_GRID_SIZE``: Maximum grid size in block
- units. Value type: ``uint64_t []``.
+ units. Value type: ``uint64_t []``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE``: Maximum block size in thread
- units. Value type: ``uint64_t []``.
+ units. Value type: ``uint64_t []``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK``: Maximum number of threads that
- a single block can contain. Value type: ``uint64_t``.
+ a single block can contain. Value type: ``uint64_t``. Shader IR type dependent.
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
- resource. Value type: ``uint64_t``.
+ resource. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE``: Maximum size of the LOCAL
- resource. Value type: ``uint64_t``.
+ resource. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE``: Maximum size of the PRIVATE
- resource. Value type: ``uint64_t``.
+ resource. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_INPUT_SIZE``: Maximum size of the INPUT
- resource. Value type: ``uint64_t``.
+ resource. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE``: Maximum size of a memory object
allocation in bytes. Value type: ``uint64_t``.
* ``PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY``: Maximum frequency of the GPU
static int
ilo_get_compute_param(struct pipe_screen *screen,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param,
void *ret)
{
static int
nv50_screen_get_compute_param(struct pipe_screen *pscreen,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param, void *data)
{
struct nv50_screen *screen = nv50_screen(pscreen);
static int
nvc0_screen_get_compute_param(struct pipe_screen *pscreen,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param, void *data)
{
struct nvc0_screen *screen = nvc0_screen(pscreen);
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
if (shader == PIPE_SHADER_COMPUTE) {
uint64_t max_const_buffer_size;
- pscreen->get_compute_param(pscreen,
+ pscreen->get_compute_param(pscreen, PIPE_SHADER_IR_TGSI,
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
&max_const_buffer_size);
return max_const_buffer_size;
}
static int r600_get_compute_param(struct pipe_screen *screen,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param,
void *ret)
{
uint64_t *max_global_size = ret;
uint64_t max_mem_alloc_size;
- r600_get_compute_param(screen,
+ r600_get_compute_param(screen, ir_type,
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
&max_mem_alloc_size);
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: {
uint64_t max_const_buffer_size;
- pscreen->get_compute_param(pscreen,
+ pscreen->get_compute_param(pscreen, PIPE_SHADER_IR_TGSI,
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
&max_const_buffer_size);
return max_const_buffer_size;
static int
trace_screen_get_compute_param(struct pipe_screen *_screen,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param, void *data)
{
struct trace_screen *tr_scr = trace_screen(_screen);
trace_dump_call_begin("pipe_screen", "get_compute_param");
trace_dump_arg(ptr, screen);
+ trace_dump_arg(int, ir_type);
trace_dump_arg(int, param);
trace_dump_arg(ptr, data);
- result = screen->get_compute_param(screen, param, data);
+ result = screen->get_compute_param(screen, ir_type, param, data);
trace_dump_ret(int, result);
/**
* Query a compute-specific capability/parameter/limit.
- * \param param one of PIPE_COMPUTE_CAP_x
- * \param ret pointer to a preallocated buffer that will be
- * initialized to the parameter value, or NULL.
- * \return size in bytes of the parameter value that would be
- * returned.
+ * \param ir_type shader IR type for which the param applies, or don't care
+ * if the param is not shader related
+ * \param param one of PIPE_COMPUTE_CAP_x
+ * \param ret pointer to a preallocated buffer that will be
+ * initialized to the parameter value, or NULL.
+ * \return size in bytes of the parameter value that would be
+ * returned.
*/
int (*get_compute_param)(struct pipe_screen *,
+ enum pipe_shader_ir ir_type,
enum pipe_compute_cap param,
void *ret);
namespace {
template<typename T>
std::vector<T>
- get_compute_param(pipe_screen *pipe, pipe_compute_cap cap) {
- int sz = pipe->get_compute_param(pipe, cap, NULL);
+ get_compute_param(pipe_screen *pipe, pipe_shader_ir ir_format,
+ pipe_compute_cap cap) {
+ int sz = pipe->get_compute_param(pipe, ir_format, cap, NULL);
std::vector<T> v(sz / sizeof(T));
- pipe->get_compute_param(pipe, cap, &v.front());
+ pipe->get_compute_param(pipe, ir_format, cap, &v.front());
return v;
}
}
cl_ulong
device::max_mem_global() const {
- return get_compute_param<uint64_t>(pipe,
+ return get_compute_param<uint64_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE)[0];
}
cl_ulong
device::max_mem_local() const {
- return get_compute_param<uint64_t>(pipe,
+ return get_compute_param<uint64_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE)[0];
}
cl_ulong
device::max_mem_input() const {
- return get_compute_param<uint64_t>(pipe,
+ return get_compute_param<uint64_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_INPUT_SIZE)[0];
}
size_t
device::max_threads_per_block() const {
return get_compute_param<uint64_t>(
- pipe, PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK)[0];
+ pipe, ir_format(), PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK)[0];
}
cl_ulong
device::max_mem_alloc_size() const {
- return get_compute_param<uint64_t>(pipe,
+ return get_compute_param<uint64_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE)[0];
}
cl_uint
device::max_clock_frequency() const {
- return get_compute_param<uint32_t>(pipe,
+ return get_compute_param<uint32_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY)[0];
}
cl_uint
device::max_compute_units() const {
- return get_compute_param<uint32_t>(pipe,
+ return get_compute_param<uint32_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS)[0];
}
bool
device::image_support() const {
- return get_compute_param<uint32_t>(pipe,
+ return get_compute_param<uint32_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
}
std::vector<size_t>
device::max_block_size() const {
- auto v = get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
+ auto v = get_compute_param<uint64_t>(pipe, ir_format(),
+ PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
return { v.begin(), v.end() };
}
cl_uint
device::subgroup_size() const {
- return get_compute_param<uint32_t>(pipe, PIPE_COMPUTE_CAP_SUBGROUP_SIZE)[0];
+ return get_compute_param<uint32_t>(pipe, ir_format(),
+ PIPE_COMPUTE_CAP_SUBGROUP_SIZE)[0];
}
std::string
std::string
device::ir_target() const {
std::vector<char> target = get_compute_param<char>(
- pipe, PIPE_COMPUTE_CAP_IR_TARGET);
+ pipe, ir_format(), PIPE_COMPUTE_CAP_IR_TARGET);
return { target.data() };
}
uint64_t __v[4]; \
int __i, __n; \
\
- __n = ctx->screen->get_compute_param(ctx->screen, c, __v); \
+ __n = ctx->screen->get_compute_param(ctx->screen, \
+ PIPE_SHADER_IR_TGSI, \
+ c, __v); \
printf("%s: {", #c); \
\
for (__i = 0; __i < __n / sizeof(*__v); ++__i) \
if (compute_supported_irs & (1 << PIPE_SHADER_IR_TGSI)) {
uint64_t grid_size[3], block_size[3];
- screen->get_compute_param(screen, PIPE_COMPUTE_CAP_MAX_GRID_SIZE,
- grid_size);
- screen->get_compute_param(screen, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE,
- block_size);
- screen->get_compute_param(screen,
+ screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
+ PIPE_COMPUTE_CAP_MAX_GRID_SIZE, grid_size);
+ screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
+ PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE, block_size);
+ screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK,
&consts->MaxComputeWorkGroupInvocations);
- screen->get_compute_param(screen, PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
+ screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
+ PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
&consts->MaxComputeSharedMemorySize);
for (i = 0; i < 3; i++) {