rusticl/kernel: properly respect device thread limits per dimension

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30504>
This commit is contained in:
Karol Herbst
2024-08-04 14:56:13 +02:00
committed by Marge Bot
parent b2225b9437
commit b3e925a21b
+1 -1
View File
@@ -1005,7 +1005,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