rusticl/kernel: properly respect device thread limits per dimension

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30504>
(cherry picked from commit b3e925a21b)
This commit is contained in:
Karol Herbst 2024-08-04 14:56:13 +02:00 committed by Eric Engestrom
parent 652387c9fb
commit 5df25b68ea
2 changed files with 2 additions and 2 deletions

View file

@ -924,7 +924,7 @@
"description": "rusticl/kernel: properly respect device thread limits per dimension",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -898,7 +898,7 @@ impl Kernel {
let total_threads = block.iter().take(work_dim).product::<usize>();
if threads != 1 && total_threads < subgroups {
for i in 0..work_dim {
if grid[i] * total_threads < threads {
if grid[i] * total_threads < threads && grid[i] * block[i] <= dim_threads[i] {
block[i] *= grid[i];
grid[i] = 1;
// can only do it once as nothing is cleanly divisible