clover: fix api zero sized enqueue
Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12225>
This commit is contained in:
@@ -271,9 +271,6 @@ namespace {
|
||||
if (dims < 1 || dims > q.device().max_block_size().size())
|
||||
throw error(CL_INVALID_WORK_DIMENSION);
|
||||
|
||||
if (!d_grid_size || any_of(is_zero(), grid_size))
|
||||
throw error(CL_INVALID_GLOBAL_WORK_SIZE);
|
||||
|
||||
return grid_size;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,10 @@ kernel::launch(command_queue &q,
|
||||
const auto m = program().build(q.device()).binary;
|
||||
const auto reduced_grid_size =
|
||||
map(divides(), grid_size, block_size);
|
||||
|
||||
if (any_of(is_zero(), grid_size))
|
||||
return;
|
||||
|
||||
void *st = exec.bind(&q, grid_offset);
|
||||
struct pipe_grid_info info = {};
|
||||
|
||||
@@ -137,6 +141,9 @@ kernel::name() const {
|
||||
std::vector<size_t>
|
||||
kernel::optimal_block_size(const command_queue &q,
|
||||
const std::vector<size_t> &grid_size) const {
|
||||
if (any_of(is_zero(), grid_size))
|
||||
return grid_size;
|
||||
|
||||
return factor::find_grid_optimal_factor<size_t>(
|
||||
q.device().max_threads_per_block(), q.device().max_block_size(),
|
||||
grid_size);
|
||||
|
||||
Reference in New Issue
Block a user