From b3e925a21ba693fd7423b45405b406bfcb8f088a Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 4 Aug 2024 14:56:13 +0200 Subject: [PATCH] rusticl/kernel: properly respect device thread limits per dimension Cc: mesa-stable Part-of: --- src/gallium/frontends/rusticl/core/kernel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 301a0bca289..1548ebc77be 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -1005,7 +1005,7 @@ impl Kernel { let total_threads = block.iter().take(work_dim).product::(); 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